Launching a UFT script from ALM project, via VBS . How to ?
I would like to know if anyone has tried to launch a UFT test through VBS file (in the file system).
This thing is needed for a scheduled test run which I need to do for nightly regression runs.
This is the URL for the ALM server:
I FAIL in this phrase :
' connecting to the ALM server
qtApp.TDConnection.Connect sServer ,sDomain, sProject, sUser, sPass, False
Anyone done this before?
Re: Launching a UFT script from ALM project, via VBS . How to ?
Hope you are doing great.
Please check the code below, it's an example about how can you connect your UFT host from ALM using vbs script:
nPath = "Root\UFT" testSetName = "TestSet1" RunSanity nPath, testSetName Sub RunSanity(nPath, testSetName) Set App = CreateObject("QuickTest.Application") App.Launch App.Visible = False Set qcApp = App.TDConnection domain = "Default" project = "xx" server = "http://x.x.x.x:8080/qcbin" user = "Admin" password = "xxx" If qcApp.IsConnected Then qcApp.Disconnect End If On Error Resume Next qcApp.Connect server, domain, project, user, password,False If err.Number>0 Then Wscript.Echo "Not able to log in on ALM, check the credentials" err.clear Exit Sub End If On Error GoTo 0 Wscript.Echo "Success connection" Set tdc = qcApp.TDOTA Set TSetFact = tdc.TestSetFactory Set tsTreeMgr = tdc.TestSetTreeManager 'Path with the test Set tsFolder = tsTreeMgr.NodeByPath(nPath) If tsFolder Is Nothing Then Wscript.Echo "Don't found the path: " & nPath Exit Sub End If Set tsList = tsFolder.FindTestSets(testSetName) If tsList.Count > 1 Then Wscript.Echo "Run the firts test" ElseIf tsList.Count < 1 Then Wscript.Echo "Don't found any test " & testSetName Exit Sub Else Wscript.Echo "Launching test" End If Set theTestSet = tsList.Item(1) Set Scheduler = theTestSet.StartExecution("") Scheduler.RunAllLocally = True Scheduler.Run Wscript.Echo "Success" End Sub
Hope this information was useful.
If you find this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the pond show your appreciation.