Micro Focus QTP (UFT) Forums
How to set resluts folder through code - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to set resluts folder through code (/Thread-How-to-set-resluts-folder-through-code)



How to set resluts folder through code - Amit Singh Chauhan - 07-29-2010

Hi All,

Can anyone tell me how can I set results folder through code?

Generaly it asks us to define folder to save results when we select run.
But I want to do it through code as I am going to run scripts through QC directly.


RE: How to set resluts folder through code - supputuri - 07-29-2010

Hi Amit,

Try this.
Code:
TestName = Environment.Value("TestName")
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\" & TestName & "\ Results" ' Set the results location
Set qtResultsOpt = Nothing
msgbox Environment.Value("ResultDir")

Please let me know if you need any more info.