Automation Testing

QC & QTP How to schedule a recurring test set

By Test Guild
  • Share:
Join the Guild for FREE

Problem – Quality center's issue with running periodic test sets

This has been a long standing issue with me and Quality Center. You can use QC to schedule a testset to run at a given time but the issue is when you need to have a testset run at a recurring time — say every day at 5:00 am.

Solution

To get testsets to run periodically you can use Vbscript with QC's OTA API and Windows scheduler.

VBScript code needed to run test set in QC

First you need to setup a VBScript that calls the Quality Center's testset that you want to run:

set tdc = createobject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "http://qcURL/qcbin/"
tdc.login "yourUserName","yourPassword"
tdc.Connect "yourDomain","yourProject"

Set objShell = CreateObject("WScript.Shell")
Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("Root\Formal Tests\YourTestDirectory")
Set tsList = tsFolder.FindTestSets("Your TestSet name. This is case sensitive!")
 
Set theTestSet = tsList.Item(1)
Set Scheduler = theTestSet.StartExecution("")
Scheduler.RunAllLocally = True
Scheduler.run

Set execStatus = Scheduler.ExecutionStatus

Do While RunFinished = False
 execStatus.RefreshExecStatusInfo "all", True
 RunFinished = execStatus.Finished
 Set EventsList = execStatus.EventsList

 For Each ExecEventInfoObj in EventsList
  strNowEvent = ExecEventInfoObj.EventType
 Next

 For i= 1 to execstatus.count
  Set TestExecStatusobj =execstatus.Item(i)
  intTestid = TestExecStatusobj.TestInstance
 Next
Loop

Window's Scheduled Tasks for Running Tests

Next you need to setup the windows scheduler to run at the desired time. See video for step by step instructions.

RunTestSet.exe – Another option

If you do not want to create your own VBScript to run your test sets you can also try an unsupported tool from HP – RunTestSet.exe.

RunTestSet is a VC++ console application that you can send command line options to in order to run a QC a test set. You can download RunTestSet and its documentation from HP or from https://testguild.com/downloads

  1. Hi Joe,
    Woww… Nice… in 2007 one of my wipro officemate ‘ Jagdeswaran Elumalai ‘did for the same. But one more point . He using triger mail, mail will triger the vbscript, script will triger to QC 8.2. once exceution complte automatically send status report to mail to user.
    Thanks for sharing the scripts.

  2. byzoor » Thanks – glad you like it! Good point — there is a SendMail method that can be email (using QC) a high level report. I’m sure, like you said, a fancier report could be created that is automatically sent. Cheers~Joe

  3. Hi Joe,

    Its Awesome.Its really helpful for some one learning OTA.

    However , i have put this script in a note pad and saved it as .vbs file . After i double click on that , its through errors
    “—————————
    Windows Script Host
    —————————
    Script: C:\Documents and Settings\nap0587\Desktop\test.vbs
    Line: 6
    Char: 1
    Error: ActiveX component can’t create object: ‘WSscript.Shell’
    Code: 800A01AD
    Source: Microsoft VBScript runtime error

    —————————
    OK
    —————————

    and

    “—————————
    WScript.exe – Application Error
    —————————
    The instruction at “0x100dfacf” referenced memory at “0x0195724c”. The memory could not be “read”.

    Click on OK to terminate the program
    —————————
    OK
    —————————

    Set tdc = CreateObject(“TDAPIOLE.TDConnection”)
    tdc.InitConnectionEx “http://qcurl/qcbin”
    tdc.Login “username”, “password”
    tdc.Connect “Domain”, “Project”

    Set objShell = CreateObject(“WSscript.Shell”)
    Set tsetfact = tdc.TestSetFactory
    Set tstreeMgr = tdc.TestSetTreeManager
    Set tsFolder = tstreeMgr.NodeByPath(“Root\Google”)
    Set tsList = tsFolder.Findtestsets(“Phase1”)
    Set theTestSet = tsList.Item(1)
    Set Scheduler = theTestSet.StartExecution()
    Scheduler.RunAllLocally = True
    Scheduler.run

    Set execstatus = Scheduler.ExecutionStatus

    Do While RunFinished = False
    execstatus.RefreshExecStatusInfo “all”,True
    RunFinished = execstatus.Finished

    Set EventsList = execstatus.EventsList

    For Each ExecEventInfoObj in EventsList
    strNowEvent = ExecEventInfoObj.EventType
    Next

    For i= 1 to execstatus.count
    Set TestExecStatusobj =execstatus.Item(i)
    intTestid = TestExecStatusobj.TestInstance
    Next
    Loop
    WSscript.quit

    I request you to please assist.

    Thanks,
    Rob

  4. Rob » Thanks Rob! This error usually means that your machine has an issue with ActiveX. I found the following fix. Can you try these steps:

    Click Start, Run and type:
    regsvr32 wshom.ocx
    regsvr32 scrrun.dll

    If the above does not help, or if you receive an error message when running the two commands above, then you may need to reinstall Windows Script 5.6 from Microsoft site.
    Let me know if this helps. Cheers~Joe

  5. Hi, joe
    I have the same problem as Rob, but your solution with regsvr32 didn’t help me. Neither reinstall of Windows Script.
    Do you have any ideas what else can helps to resolve this issue?

    Thanks

    P.S. the only difference is that I got error on line “Set Scheduler = theTestSet.StartExecution()”
    P.P.S. I’m running on Windows 2003 SP2 x86

  6. Hello,

    Thx Joe ;)

    But i have the same problem too. “ActiveX component can’t create object” on line “Set Scheduler = theTestSet.StartExecution(“”))

    … :S

    Benoit.

  7. Hello,

    My last comment was moderate about the issue with the ActiveX. Anyway i resolved the problem and i wanted to share with you the solution.
    I just run the ALM Client Registration. I’m using ALM 11 so the link is: http://:8080/qcbin/start_a.jsp?common=true. It works fine right after for me.

    But, i have an other problem.. I use your code in a VAPI-XP program. And i never get out of the While Loop. The “execstatus.Finished” is always False even after the end of the test. Actually it’s even worse it returns nothing, so i use the code below if i want the executionStatus returns something but it is always False.

    (This code below run QTP scripts on a remote virtual machine by the way. This part works fine.)

    ——————-
    ——————-

    Set TestSetFact = TDConnection.TestSetFactory
    Set tsTreeMgr = TDConnection.TestSetTreeManager

    Set TestSetFact = tdc.TestSetFactory
    Set tsTreeMgr = tdc.TestSetTreeManager

    ‘Get the test set folder.
    Set tsFolder = tsTreeMgr.NodeByPath(“”)

    ‘On Error GoTo RunTestSetErr
    Set tsList = tsFolder.FindTestSets(“”)
    If tsList.Count > 1 Then
    MsgBox “FindTestSets found more than one test set: refine search”
    ElseIf tsList.Count < 1 Then
    MsgBox "FindTestSets: test set not found"
    End If

    Set theTestSet = tsList.Item(1)

    'Start the scheduler on the local machine.
    Set Scheduler = theTestSet.StartExecution("")

    ''''''''''''''''

    Set TSTestFact = theTestSet.TSTestFactory
    Set tsFilter = TSTestFact.Filter
    tsFilter.Filter("TC_CYCLE_ID") = theTestSet.ID
    Set testList = TSTestFact.NewList(tsFilter.Text)

    'For each test instance, set the host to run depending
    'on the planning in the test set.
    For Each TSTst In testList
    Scheduler.RunOnHost(TSTst.ID) = TSTst.HostName
    Next
    Scheduler.RunAllLocally = False

    ''''''''''''''
    Scheduler.Run

    'set execStatus = Scheduler.ExecutionStatus
    'execStatus = Scheduler.ExecutionStatus.Finished
    While (RunFinished = False)
    'execstatus.RefreshExecStatusInfo “all”,True
    'RunFinished = execstatus.Finished
    Scheduler.ExecutionStatus.RefreshExecStatusInfo "all", True
    RunFinished = Scheduler.ExecutionStatus.Finished

    'Set EventsList = execStatus.EventsList
    'For Each ExecEventInfoObj In EventsList
    ' strNowEvent = ExecEventInfoObj.EventType
    'TDOutput.Print strNowEvent
    'Next

    'For i = 1 To execStatus.Count
    ' Set TestExecStatusObj = execStatus.Item(i)
    ' intTestID = TestExecStatusObj.TestInstance
    'TDOutput.Print intTestID
    'Next
    Wend
    ——————-
    ——————-

    Any help would be very appreciate.
    Thank you for your time.

    Best regards,
    Ben.

  8. Benoit » What I usually try, on the machine that is giving me issues,is the following:

    1) Navigate to QC (even if this is just a qtp run test machine) and let it download the QC active-x control
    2) Install or Re-Install the HP Quality Center Connectivity add-in
    3) Install or Re-Install the QuickTest Pro Add-in

    Please let me know if this helps. Cheers~Joe

  9. Hello,

    For you information. I’m using the Test Run Scheduler now. I call it from a VAPI-XP program. It works fine.

    It works when i run the tests on a remote host. But It does not work when i run them in local. It seems the VAPI-XP window block the execution of QTP. I don’t know why. If you have any idea..

    Thank you.

    Regards,
    Ben.

  10. Hi Joe,

    I’m an novice on using on QC and just trying to install it. After at least one week wrestling with the installation process and getting stuck in multiple integrity issues with my db… now I’m stuck with a jboss integration issue. As jboss zip file coming along with the QC pkg didn’t unpack, I had to do a workaround and point the QC config tool to my own instance jboss which I downloaded myself. I did run the run script for jboss so I could get things going. However, for launching QC I’m still hitting the wall. I get this error: The requested resource (/qcbin/SiteAdmin.jsp) is not available. The QC bin is somehow still stuck in the war file. Any idea? I do appreciate your help. Thanks. Shar

  11. shar » Hi Shar – I’m not sure what is happening. I do not see any known issues. What version of QC are you trying to install? Also what verison of Jboss and what db are you using? Has anyone else seen issue similar QC/jboss install issues?

  12. Hi. Thanks for your reply. I’ve been looking for clues and similar problems and even used HP’s self-solve km to look for issues like this. But I’ve not found much. I’m using ALM 11, jboss 5.1 and sql server 2005. Any thoughts? Thanks.

  13. Hi Joe,

    I am trying to run my QTP(v11) scripts using Windows Scheduler. I have created a vbs file to launch the application and open the QTP script and run it.

    But when tasks gets executed, .vbs file is getting opened instead of launching an application and running the script.

    Could you please let me know what might be the problem.

    Thank you

  14. I have been trying tio use the RunTestSet method with no luck.

    I have my Run set as:
    “C:\Documents and Settings\a641422\Desktop\RunTestSetScheduler\Release\RunTestSet.exe \s:http:\qc-alm.wellsfargo.com\qcbin \n:W_S \d:BS \u:a641400 \p:$Mikie201 \f:O:\QTP Tests \t: 1 – Image Access by ENV-5 \l”

    And my Start In set as:
    “O:\QTP Tests\NightlyRegressionTesting”

    am I missing anything?

  15. I have been working with your document TestSet Sceduler Solution with no luck. Can we get a copy of your vbs file?

    I also need to run the scheduler after my system has timed out or logged off due to inactivity.

    Any ideas on this?

  16. Lor » HI Lor – I placed a copy of one of my vbs testset sceduler scripts (QC_TestSet_scheduler.vbs) on my downloads section:

    https://testguild.com/downloads/

    Also on all my lab machines I have the screensaver turned off and a registry setting that automatically logs me on to the machine.

    Hope this helps,

    Joe

  17. I guess that is my issue. I cannot turn my screen saver off. I thought I had Admin rights but I guesss not. I think I will need to run via QC or contact the help desk to configure my system.

    I did look in my regestry but I could not find any settings to turn off the screedn saver or change my settings to automaticlly log me in. We have tons of security systems monitoring our every key punch.

    thx Joe

  18. Hi Joe,

    I created a similar solution for running automated tests (BPT) using QTP11 and QC11 where the user plans tests in QC and they are run on the specified date/time on a specified remote host.
    Nevertheless, I do have some trouble with the automatic logon. As you are saying “a registry setting that automatically logs me on to the machine”, I suppose that you have a solution for this problem. Can you specify which regkey you are manipulating?

    Thanks!
    Johan

  19. Hi,

    I am trying something similar for HP Service Test scripts.I need to download the “replay log file” after executing the Test.Please inform how can i download the log file after execution.

    Thanks,
    Aditya Reddy

  20. aditya » Hi Aditya – when you say “replay log file” are you referring to the Output>Run results? If so I don’t think they are stored in QC (i’m not 100% sure). After you run a ST test the log files are stored locally under ST>Tools>Open Containing Folder> There should be a Log directory. The file named vtd_user.log contains the output>run results. You could create code that attaches each output results to a test lab in QC. Please let me know if I’m misunderstanding your question. Cheers~Joe

  21. hello Joe–thanks for providing this resource! i have been using RunTestSet.exe, but have recently run into an issue where it crashes trying to disconnect from the TD Server.

    given that, i’m looking forward to implementing this solution. One thing though, with RunTestSet, i point to a host group so that the tests are spread out to all of my QTP machines. how can i do this with the above example? i see “Scheduler.RunAllLocally = True”, which implies to me there could be a way i could point to a particular host group (?). if that’s the case, could you explain the syntax to achieve that?

    much appreciated.

  22. i seem to have it working. had to add Scheduler.TdHostName = “” and remove Scheduler.RunAllLocally. when i just changed that from True to False, I received an error.

  23. Hi Joe,
    your solution worked perfectly for me to schedule batch jobs on QC 11 (ALM) and QTP 11. Thanks for your help and insight. I was trying to take it a step further by trying to invoke the automatic email generated with results summary (under the Automation tab) from QC which works when your run tests thru QC but doesnt generate when the tsts are executed thru batch job. have you had any experience with this feature?

    Thanks
    Manish

  24. Manish » Hi Manish does using the SendMail method in your scheduling vbscript help?

    set tdc = createobject("TDApiOle80.TDConnection")
    tdc.SendMail "listOfEmailAddress","","Subject","Message"

  25. Hi Joe,
    I want to execute all the test sets in a given folder, so I modified above code as below. However it execute only first test set from test folder and wscript.exe get closed. Second test set does not execute.
    My test folder contains 5 test sets.
    below is the code
    ‘********************************************************************
    TSFolderPath = “Root\Z.Delete\A TEST\”
    Set TSetFact = tdc.TestSetFactory
    Set tsTreeMgr = tdc.TestSetTreeManager
    Set tsFolder = tsTreeMgr.NodeByPath(TSFolderPath)
    Set tsList = tsFolder.FindTestSets(“”) ‘ Get all test sets
    If tsList.count >= 1 Then
    For tsIndex = 1 to tsList.count
    Set theTestSet = tsList.Item(tsIndex) ‘ TestSet Object
    Set Scheduler = theTestSet.StartExecution(“”)
    Scheduler.RunAllLocally = True
    Scheduler.run
    Set execStatus = Scheduler.ExecutionStatus
    Do While RunFinished = False
    execStatus.RefreshExecStatusInfo “all”, True
    RunFinished = execStatus.Finished
    Set EventsList = execStatus.EventsList

    For Each ExecEventInfoObj in EventsList
    strNowEvent = ExecEventInfoObj.EventType
    Next

    For i= 1 to execstatus.count
    Set TestExecStatusobj =execstatus.Item(i)
    Next
    WScript.Sleep 5000
    Loop
    Next ‘Go to next TestSet
    else
    Msgbox “Test Set not found under test folder : ‘” & TSFolderPath & “‘.”
    End If

    Please tell me where I have to modify the script.

    Thanks,
    Vikas

  26. Hi Joe,
    I’m able to execute all automated BPT test set in a given test folder.
    Thanks for this code.
    Vikas

  27. One more query.
    How we can execute fixed number of test cases from a single test set?
    Consider I have a test set with 20 test cases.
    I want to execute only first 10 test cases out of 20 from a test set. Where I have to change the code.

    Please suggest.

  28. Hi Joe,
    I’m trying to run the script on windows 7 32 bit with QC 9.0.When i run manually from browser my test case is running fine.When I tried use this script It starts the TD test run scheduler but wont execute the test and it stops at that point. Same code is working in Windows XP. Using Msgbox i tried to display testcase ID ,name. Its returning it properly.Its failing at the point of execution. I tried everything mentioned in the site. Still it dint work for me.Its really urgent for me as i wasted 1 week already on troubleshooting this.

  29. Hi Joe,

    Very good job. It works here. One more concern, in the third line of your script:
    “set tdc = createobject(“TDApiOle80.TDConnection”)
    tdc.InitConnectionEx “http://qcURL/qcbin/”
    tdc.login “yourUserName”,”yourPassword”

    I need put my username&password here, so there is a security concern here. Can we encrypt password here like what QTP does?

  30. Vincent » HI Vincent – We use a generic ALM/QC user for our scheduler scripts so we don’t usually encrypt the password. You could store the password in a DB and write some code that reads the password from the DB but I don’t think that would be super secure. Anyone else have any ideas?

  31. Hi Joe,

    Thanks for the helpful post. I had tried the RunTestSet.exe. It was successful. Moreover, I found an issue that, in the email notification the test set name and tester name are displaying in symbols..Any thought on this?? Thanks in advance

    Regards
    Rohith

  32. @ zoor
    I know this guy Jagadeeswaran Elumalai.
    What is the tool name that will schedule the qtp scripts in batch mode?
    To run independently.
    I forgot that application.

  33. Hi All,.
    I am looking for QTP code for Sending the email with Test Result attachment from QC through Lotus Notes.
    I did QTP script to attach the Test Results in Test Lab module, but the email is triggered without the attachment.

    Can any one please help me on this.

    Thanks

  34. Thank you ver much for such a great information. Is there any way I can provide specific test names of test set to execute instead of executing whole test set.
    Thanks

  35. Hey Rob,
    My question is related to Saro’s, I have an email notification set on my testset in case of a failure, but since IE doesn’t actually open QC can’t send the email upon failure. Is there a way to run this script with QC being visibly open? Thanks.

  36. hi Joe,

    After running above steps, my Test Run scheduler is opening but getting error “the requested operation requires elevation”. Tried both the methods, but getting same error in Test Run scheduler. I am using Win 7. Please assist.

    Thanks in advance

  37. Priyank » Verify your QC/ALM and local machine permissions. I’ve never seen this error before but I’ve seen similar errors caused by permission or misspelling errors. Anyone else seen this before?

  38. I have question in QTP n QC…

    Scenario: how to run multiple QTP scripts from QC on different remote machines, say for example 100 script in QC test lab, to run on 5 machines, each machine having 20 scripts, while running all at a time from QC, if one of the machine’s h/w got crashed, these scripts are stopped, so at any cost we need to execute them (not manually) those scripts should automatically distribute or run on any available machine.

    Plz help me in this

    -thanks,
    SK

  39. Hi Joe,

    I’ve tried the RunTestSetScheduler tool from your website and ran into the following issue:

    C:\>RunTestSet /s:https://myalmserver/qcbin /n:DOMAIN /d:Project /u:myUser /p: /l /t:MyTestSet /f:Root\folder
    Initializing TDServer https://myalmserver/qcbin
    Connecting to DOMAIN.Project project
    Checking TestSet : Root\folder\MyTestSet
    Opening Scheduler…
    Error: Error: Class not registered

    Do you have any idea what’s wrong? It “feels” like Opening Scheduler times out:

    printf(“Opening Scheduler…\n”);
    // get scheduler
    ITSSchedulerPtr spScheduler = spTestSet->StartExecution(_T(“”));

    I have the Remote Agent installed as well as the connection AddIn. Are there any requirements I missed?

    Thanks!

  40. Joe,.

    in the meatime I’ve solved the issue.

    I had to reregister the HP ALM client from https://xxx/qcbin/start_a.jsp?common=true. I’ve seen this solution here before, but it did not work for me the first time.

    But after deleting the client directory at
    C:\Users\All Users\Application Data\HP\ALM-Client it was successfully installing the client and registering all DLLs.

    All issues gone now. Hope this helps!

  41. hi Joe,

    Nice job, I am able to run the whole test set using the above code. But is there a way where we can just run only the failed scripts in a test set and also can we run only few scripts from a give test set. Like only 5 scripts from a test set which as 20 scripts.

    thanks,

  42. HI,
    I have created batch runner as above. I am taking Test set name value from Excel file. There will be more than 25 testsets I will be executing from batchrunner.
    Now, batchrunner is running for first testset and it is trying for second one before first completes run. I can not put wait as i do not know how much time each test will take to execute.
    Now I want to put wait time so until one test set gets executed, Loop should not go to next test set from Excel.
    I need to do it. Can someone help to resolve issue?

  43. Joe ,

    The script is very helpful to me.But i am very weak at scripting languages.

    could you please customize it to me as per my rewuirement..

    It will be great help…

    Scenerio :

    I don’t want execute all tests under the TestSet..

    i wan’t to execute selected test under Testset..

    Please help me….

    Thanks
    Nagaraj

  44. Hi Joe ,

    Nice work…Script & concept helped me a lot….
    I am able to execute all the Testcases under Testset….

    Suppose i wan’t to execute required test cases (not all only few) then where shall i have to change the code…Please help me….

    If anyone knows about this ,Please help me ….:)

  45. Hi Joe,

    I have created below .VBS file for QTP11 and QC11. It’s not running the qtp scripts. When I am directly running it from QC it’s running fine. Please have a look and revert.

    ‘************************************START*******************************************

    Const QCuser=”q1wa”
    Const QCpassword=””
    Const QCdomain=”X_FORVALTNING”
    Const QCproject=”Bankplatform_finacle_auto”
    Const QCURL=”http://nkm18du3.nykreditnet.net:8080/qcbin”
    ‘********Declare the variables*******
    Dim qtpApp,logFileName,QCConnect,tsTreeManager,testSetFolder,mytestSet,tsList
    ‘*************************************
    logfileName = replace(replace(now,”/”,”_”),”:”,”_”)&”.txt”
    logfilepath =”C:\AutomateTest\Logs\”& logfileName
    msgbox logfilepath
    ‘************************************
    QCLogin
    mytestSet=”Set1″
    ‘Found the test set
    ‘Code to select the testset need to run
    set tsTreeManager= QCConnect.TestSetTreeManager
    set testSetFolder=tsTreeManager.NodeByPath(“Root\My_Suite”)
    set tsList=testSetFolder.FindTestSets(mytestSet)
    LogThis”Total Test Sets found are ” & tsList.count
    set theTestSet=tsList.Item(1)
    LogThis “Name of TestSet is “& theTestSet.Name
    LogThis “ID of TestSet is “& theTestSet.ID
    Set scheduler= theTestSet.StartExecution(“”)

    ‘scheduler.runAllLocally=True
    Scheduler.TdHostName = “NKM17ARI”
    scheduler.run
    set execStatus= scheduler.ExecutionStatus
    RunFinished=False
    While (RunFinished=False)
    execStatus.RefreshExecStatusInfo theTestSet.ID,True
    RunFinished=execStatus.Finished
    Wscript.Sleep 5000
    Wend
    LogThis”Test Set Executed Sucessfully”

    ‘While Not scheduler.executionstatus.finished
    ‘Wscript.Sleep 5000
    ‘Wend
    ‘LogThis”Test Set Executed Sucessfully”

    Set tsTestFact=theTestSet.TSTestFactory
    Set testSetTestsList=tsTestFact.NewList(“”)
    For Each theTSTTest In testSetTestsList
    With theTSTTest
    ‘LogThis “Name: “& .Name & “, ID: ” & .ID & “, status: ” & .Status
    End With
    Next
    Logout
    LogThis”Logged Out to QC”
    ‘************************************
    Public Function QCLogin
    LogThis(“Connecting to QC”)
    Set QCConnect=CreateObject(“TDApiole80.TDConnection”)
    ‘Give QC URL
    QCConnect.InitConnectionEx QCURL
    ‘Check if we are able to hit the qc server
    If Not QCConnect.connected Then
    LogThis “Not able to hit the QC Server”
    WscriptQuit
    End if
    ‘Give Username and password
    QCConnect.Login QCuser,QCpassword
    ‘Checked If you logged in
    If Not QCConnect.LOggedIn Then
    LogThis “Not able to Logged to QC”
    WscriptQuit
    End If
    LogThis “Sucessfully Login in QC”
    ‘select domain & project
    QCConnect.Connect QCdomain,QCproject
    ‘Checked If you get connected to domain and project
    If Not QCConnect.ProjectConnected Then
    LogThis “Not able to connect to project”
    WscriptQuit
    End If
    LogThis “Sucessfully Login in Project — Continue”
    End Function
    Public Function Logout
    ‘LogOut
    QCConnect.Disconnect
    QCConnect.LogOut
    QCConnect.ReleaseConnection
    End Function
    Function LogThis(msg)
    Dim fso,myfile
    Const ForAppening=8
    Set fso=CreateObject(“Scripting.FileSystemObject”)
    Set myfile=fso.OpenTextFile(logfilepath,ForAppening,true)
    myfile.writeLine now &” –> ” & msg
    Set fso=Nothing
    Set myfile=nothing
    End function
    ‘******************************************END*********************

  46. The solution to deleting: C:\Users\All Users\Application Data\HP\ALM-Client, was key to solving my problem of not being able to re-register the client!!

    Thanks for finding this elusive folder and trying it out.

    What’s confusing is this same folder exist under my user account and is recreated when accessing QC from my Web Browser for the first time…

    Wish this solution was more clearer as I even went the route of uninstalling C++ 2005, 2008 distributable with no success there.

    I’m now able to use RunTestSet!!

  47. My test cases automated with ALM with BPT and QTP 11.

    The test data was mapped to test resource folder in the form of excel ( Dynamic data in BPT)

    when run the test cases from test lab manually means select test cases and click run that moment, while execution it is
    picking dynamic data as expected and execution working fine

    when run the same test cases through OTA code, while execution it is taking static data instead of dynamic data, but execution working fine.

    pl provide solution.

    I am using the below code:
    set tdc = createobject(“TDApiOle80.TDConnection”)
    tdc.InitConnectionEx “http://qcURL/qcbin/”
    tdc.login “yourUserName”,”yourPassword”
    tdc.Connect “yourDomain”,”yourProject”

    Set objShell = CreateObject(“WScript.Shell”)
    Set TSetFact = tdc.TestSetFactory
    Set tsTreeMgr = tdc.TestSetTreeManager
    Set tsFolder = tsTreeMgr.NodeByPath(“Root\Formal Tests\YourTestDirectory”)
    Set tsList = tsFolder.FindTestSets(“Your TestSet name. This is case sensitive!”)

    Set theTestSet = tsList.Item(1)
    Set Scheduler = theTestSet.StartExecution(“”)
    Scheduler.RunAllLocally = True
    Scheduler.run

  48. Hi,
    I have qc 8.2 test cases data, now I want to export all test cases from QC 8.2 to an excel sheet.
    Can you please provide me the solution.
    createobject(“TDApiOle80.TDConnection”) is giving run time error for me.

  49. Does this sample code work or do you get same error?

    QCURL = “http://192.6.38.117:8080/qcbin/”
    QCUser = “demo_admin”
    QCPass = “hphphp”
    QCDomain = “DEFAULT”
    QCProject = “QualityCenter_Demo”

    Set TDConnection = CreateObject(“TDApiOle80.TDConnection.1”)
    TDConnection.InitConnectionEx QCURL
    TDConnection.Login QCUser, QCPass
    TDConnection.Connect QCDomain,QCProject

    If TDConnection.ProjectConnected Then
    Set TestFact = TDconnection.TestFactory
    Set tests = TestFact.NewList(“”)
    For Each test In tests
    msgbox “[QualityCenter] ” & test.Field(“TS_SUBJECT”).Path & “\” & test.Name
    Next
    TDConnection.Disconnect
    TDConnection.Logout
    End If
    TDConnection.ReleaseConnection
    Set TDConnection = Nothing

  50. Hi Joe,

    After manually opening remote machine if I execute RunTestSet its working, but when I have closed my remote machine how to execute scripts using RunTestSet. Its not working.

  51. What are you using to connect to the remote machine Remote Desktop Connection? If its RDP I think its the way RDP works that is causing the issue. I use VNC to connect to my remote machines to get around this behavior

  52. Joe,
    As always, you have such great content online for the automation folks. Thanks for publishing this article, I look forward to our next chat.

    Greg

  53. In your code above, you have run all tests locally. I do remember that for ALM to run a test locally, the UFT/QTP should have the option” Allow other tools to access UFT” selected. Can we set this option without actually opening UFT, like through a code or something??

  54. Hi Joe,

    The code above does not seem to be working for BPT components? Can we use OTA to run BPT components from ALM?

  55. After run the testset form QC , UFT 12.02 is automatically closed.
    Is there a option to keep open UFT even after stopped/run the testtset from QC ??

  56. when i try to download Run Test Set I’m getting an error message saying you do not have permissions to download

    Can you please help me with that

    Thanks,
    Saritha

  57. Hi Saritha – links should be working now. I changed hosting providers last year and forgot to update these links. Thanks for letting me know! Cheers~Joe

  58. Hi Joe,

    Is HP – RunTestSet.exe work with UFT vs ALM11? it is working fine with QTP vs ALM 11.

    Thanks,
    Shyam

  59. Hi Joe,

    Thanks for your Script…

    Set Scheduler = theTestSet.StartExecution(“”)
    This piece of code is giving me error

    Could you please give me a quick solution for the same.

    Regards,
    Rachna

  60. It is 2017 and there is still no user friendly scheduler in HP ALM.
    But at least you can set exact date and/or time to run Test Plan. So daily runs are possible.
    How about weekly runs?
    As option you may create simple script to check current day, pass for Moday, fail for rest.
    Then in Test Lab add Execution Condition to run only if your simple test script has passed.

  61. Hi Joe,
    I am automating a Desktop Based or Host based application, I am using UFT 14.0 for automation.

    I am able to automate most of the application wizards, Basically I use Objectspy to identify the objects and write code accordingly for the required test.

    However, When I try the same Objectspy to find objects and automate Installer Part that uses ‘InstallShield” method for installation, Object Spy is able to identify the Objects, But When I Write Code for these objects were not recognized at Run.

    Even I tried Record and Play for Installer, It records but during Play Objects were not recognized.

    I am Puzzled on what is the problem here?? Can you guide me the Path..

    Thanks in Advance. Apppreciate your help.

    Thanks,
    Chandra

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Symbolic AI vs. Gen AI: The Dynamic Duo in Test Automation

Posted on 09/23/2024

You've probably been having conversations lately about whether to use AI for testing. ...

8 Special Ops Principles for Automation Testing

Posted on 08/01/2024

I recently had a conversation, with Alex “ZAP” Chernyak about his journey to ...

Top 8 Open Source DevOps Tools for Quality 2024

Posted on 07/30/2024

Having a robust Continuous Integration and Continuous Deployment (CI/CD) pipeline is crucial. Open ...