Site icon Vinsguru

QTP/UFT – How to Pass Test Parameters from Jenkins

Aim:

To run the QTP/UFT script on any given test environment using Jenkins by passing the environment as a parameter to the QTP/UFT test.

 

Please read this post first to get a high level idea of basic QTP/UFT + Jenkins integration.

 

Creating Simple Test Script with Test Parameters:

Using Property Files:

 

QTP/UFT  Test Folder Structure:

Our QTP/UFT test will contain below folders at least.

Reading Property Files:

These properties will be stored as Environment Values of the QTP/UFT script.  For that, We need to attach a separate vbs file which reads the property file to the QTP/UFT test.

Updating runner.vbs to accept arguments from command line:

We need a separate vbs file which uses QTP/UFT Automation Object Model to invoke QTP, open the test and run.   I name the file as runner.vbs – it will be created as shown below to accept arguments from the command line.

At this point, you should be able to run your test through command line on any test environment as shown here.

 

QTP/UFT should invoke successfully and run the test on the given environment. Ensure that it works before integrating with Jenkins. [If it fails, executing through jenkins is not possible]

Jenkins – Creating a Job with Parameters:

 

 

 

 

 

Happy Testing & Subscribe 🙂

 

 

 

Share This:

Exit mobile version