Setting the results directory in UFT automatically
Question ID: 108545
0
0

I have a tester that is using a batch file to call UFT and execute a UFT script. When trying to run UFT in this manner, the storage of the normal UFT results is not being saved into the same (temp) location that was being used the last time this user ran a script manually. It is being saved to the script location and is producing a large number of test results, as the test is executed a lot. We would like to direct UFT thru the batch file to save the results to the C:\\temp folder every time. Is there a way to do this?

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on July 27, 2018 2:04 am
550 views
Answers (1)
0
Private answer

I think you might want to make sure you are using the RunResultsOptions object in your script. I will include a sample below for you to use a template. Pay particular attention to the two lines:

Set qtResultsOpt = CreateObject(''QuickTest.RunResultsOptions'') ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = ''C:TestsTest1Res1'' ' Set the results location

Here is the main example script with the results used that I pointed out above:

'

************************************************************************************************************************
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in UFT.
'For more information, see the example for the Test.SaveAs method.
'When UFT opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Dim qtAutoExportResultsOpts 'As QuickTest.AutoExportReportConfigOptions ' Declare the Automatically Export Report Configuration Options object variable

Set qtApp = CreateObject(''QuickTest.Application'') ' Create the Application object
qtApp.Launch ' Start UFT
qtApp.Visible = True ' Make the UFT application visible

' Set UFT run options
qtApp.Options.Run.ImageCaptureForTestResults = ''OnError''

qtApp.Options.Run.RunMode = ''Fast''
qtApp.Options.Run.ViewResults = False

qtApp.Open ''C:TestsTest1'', True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = ''rngIterations'' ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = ''NextStep'' ' Instruct UFT to perform next step when error occurs

Set qtResultsOpt = CreateObject(''QuickTest.RunResultsOptions'') ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = ''C:TestsTest1Res1'' ' Set the results location

' Set options for automatic export of run results at the end of every run session

Set qtAutoExportResultsOpts = qtApp.Options.Run.AutoExportReportConfig
qtAutoExportResultsOpts.AutoExportResults = True ' Instruct UFT to automatically export the run results at the end of each run session
qtAutoExportResultsOpts.StepDetailsReport = True ' Instruct UFT to automatically export the step details part of the run results at the end of each run session
qtAutoExportResultsOpts.DataTableReport = True ' Instruct UFT to automatically export the data table part of the run results at the end of each run session
qtAutoExportResultsOpts.LogTrackingReport = True ' Instruct UFT to automatically export the log tracking part of the run results at the end of each run session
qtAutoExportResultsOpts.ScreenRecorderReport = True ' Instruct UFT to automatically export the screen recorder part of the run results at the end of each run session
qtAutoExportResultsOpts.SystemMonitorReport = False ' Instruct UFT not to automatically export the system monitor part of the run results at the end of each run session
qtAutoExportResultsOpts.ExportLocation = ''C:Documents and SettingsAll UsersDesktop'' 'Instruct UFT to automatically export the run results to the Desktop at the end of each run session
qtAutoExportResultsOpts.UserDefinedXSL = ''C:Documents and SettingsAll Users

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on July 27, 2018 2:07 am
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top