After I run my scripts in UFT, I want to store results in a word document that will have the same name as my tests or be relevant to test, so I can easily differentiate which result belong to which test.
Can anyone help me with that?
Here is the code:
Dim oWord
Set oWord = CreateObject("Word.Application")
oWord.Documents.Add
oWord.ActiveDocument.Saveas "C:\Users\Desktop\RunResults\TestForWordDocResults2"
Dim oWordTestPath
oWordTestPath = "C:\Users\Desktop\AutomationScripts\TestForWordDocResults"
' Launch QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Run the Test
qtApp.Open oWordTestPath, False ' Open the test
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") 'Create the Run Results Options object
testResults = "C:\Users\Desktop\RunResults"
' Original location for the test results.
qtResultsOpt.ResultsLocation = testResults ' Specify the location to save the test results.
oWordTestPath.Run qtResultsOpt, True ' Run the test and wait until end of the test run
' Close QuickTest Professional
qtApp.Quit
What this code does: it creates Word document, but doesn't store run results.
P.S. I want to store run-results using driver script, not "options" in UFT