Execute a TestSuite using OTA API and vbscript

 

Here I explain how to run Automatic TestSet with a simple vbscript that use OTA API.

 

This solution is based on 2 steps (same script):

  1. Retrieve the TestSet that must be run
  2. Execute the TestSet and retrieve the results

 

TestSets are stored in the TestLab module and every company decides how to organize them in the tree-model, which is the best way to collect and store them. 

 

Suppose (this is not the way we implement it in our company) to have a tree-model structure like this:Root - <APPLICATION> - <ENVIRONMENT> - <TESTSET>

 

To retrieve all the TestSet for a specific Application + Environment we must build a script that accept some input parameters such as Domain - Project - User - Password - ApplicationName - Environment

 

The script will do these steps:

  • Verify the number of arguments passed through the wscript.arguments.count statement. If Ok it will store informations on global variables
  • Connect to the Project with the first 4 informations
  • Create the TestSetTreeManager object to manage the testset tree
  • Retrieve the Folder object using the NodeByPath property
  • Retrieve all the TestSet using the .FindTestSets method with ("",False,"") arguments.
  • Create a foreach cycle on the list of testset retrieved from the FindTestSets method and call a RunTestSet procedure (sub) for each testset
  • In the RunTestSet sub create the TSScheduler from .StartExecution property to run the TestSet and then get information status as I already mentioned here 

 

How to call the script?

The script runs on a Windows Client with OTAClient.dll installed. It must be called from wscript.exe or cscript.exe under c:\windows\SysWOW64 folder because of 32bit DLLs.

 

You can decide to Run all tests on this machine or on a remote machine. The Scheduler will run always on local machine but can do remote runs.

 

For a real continuous testing you should trigger the script from an external system able to orchestrate and execute remote command (such as HPOO or Jenkins)

 

Pag: <   >   >>