Highlighted
Visitor.
117 views

Run UFT Solution from vbs Batch file

Hi Folks,

 

try to start UFT with an solution from VBS Batch script. After Research in Google i came up with this script.

But it looks like I cam only load Actions but not Solutions. Any idears?

###################

Dim qtApp
Dim qtResult
Dim qtTest

'Create the QTP Application object
Set qtApp = CreateObject("QuickTest.Application")

qtApp.Launch

'Make the QuickTest application visible
qtApp.Visible = True

'Set QuickTest run options
'Instruct QuickTest to perform next step when error occurs

qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "F:\Eigene Dateien\100_Solution\test", true

Set qtTest = qtApp.Test
'Set qtTest = qtApp.Solution

'Instruct QuickTest to perform next step when error occurs
qtApp.Test.Settings.Run.OnError = "NextStep"

'Run the test
qtApp.Test.Run

'Check the results of the test run
MsgBox qtApp.Test.LastRunResults.Status

' Close the test
qtApp.Test.Close

'Close QTP
qtApp.quit

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

hi, 

AOM, the vbs script you write, supports only one Test at a time. The Application object, the handler of UFT, can open just one Test and not multiple ones like you can do in UFT IDE. 

see more details from here:

https://admhelp.microfocus.com/uft/en/all/AutomationObjectModel/Default.htm

thanks.

James

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.