Sunteți pe pagina 1din 12

HP UFT/QTP integration with Jenkins

Installing Jenkins
First, you need to start Jenkins before installing it. This can be done from JNLP, or by
running "java -jar jenkins.war".

Now connect to Jenkins by going to the following URL http://<hostname>:8080/

Integrating Jenkins with QTP/UFT


We can integrate QTP/UFT with Jenkins starting version from QTP 11.0 to later versions
Once you are done with installation we can see HP Application Automation tools available in
“Installed” tab

Running QTP/UFT script from Jenkins


Set up a job

1. Go to the Jenkins Server home page.


2. Click the New Job link or select an existing job.
3. Enter a Job name (for a new job).
4. Select Build a free-style software project and click OK

5. In the Project Configuration section scroll down to the Build section.


6. Expand the Add build step drop-down and select Execute HP tests from
file system.

8. In the Tests box, enter a test with its full absolute path, or a folder or MTB
containing one or more tests or LoadRunner scenarios. To specify multiple entries,
click the down arrow on the right of the field and enter each test path on a separate
line. Make sure that the paths are accessible from all machines in the local network.

For functional tests (UFT), you can also indicate a batch file that contains a list of
tests, along with their parameters. You can specify multiple tests, or the same test
several times with different parameters. Note that you can use Jenkins environment
variables in the path names. The batch file should have an .mtbx extension and
follow this sample syntax.
<Mtbx>

<Test name="test1" path="c:\tests\APITest1">


<Parameter name="A" value="abc" type="string"/>
….
</Test>
<Test name="test2" path="${WORKSPACE}\test2">
<Parameter name="p1" value="123" type="int"/>
<Parameter name="p4" value="123.4" type="float"/>
….
</Test>
</Mtbx>

1. Optionally, indicate a timeout in seconds after which the job will fail in
the Timeout box.
2. Click Apply to save your changes and continue with more build steps.
Click Save when you are finished adding build steps.

Set up the Post Build Actions

1. In the Post-build Actions section, expand the Add post-build action drop-
down and select Publish HP test result.
2. Select an archiving option for the test run results:
* Archive test run results for failed tests - save test results for failed tests only
* Always archive test run results - always save test result reports
* Do not archive test run results - never save the test results
Run the job

1. Run or schedule the job as you would with any standard Jenkins job.

Review the results


1. From the dashboard, click on the job.
2. Click the Build Artifacts link to view the results zip files.
3. Extract the zip file.

In functional tests, the extracted zip file contains the result files, viewable in the Run
Results Viewer. To view the results:

1. Open the Run Results Viewer and select File > Open.
2. In the Open dialog box, select Results XML file and navigate to
the Results.xml file in the folder that you extracted.
3. Click Open and view the results.

Install HP Application Automation


Tools Plugin
1. Login to Jenkins.

2. Click the link “Manage Jenkins” -> “Manage Plugins”, then click
“Advanced” tab.

3. Enter the Server “web-proxy.rose.hp.com” and Port “8088”, then click


“Submit”.
1. Click “Available” tab.

2. Filter the name “HP Application Automation Tools”.

3. Click on the Install checkbox and click on the “Download Now and
Install After Restart“ button.
Config Jenkins

Set up a job
1. Click on the “Jenkins“ –> “New Item“ menu option.

2. Enter a Job Name as “UFT Integration Test” and click on the ”Free Style
Project”.
1. Configuration Screen will Open. Select Build Tab and click on the “Add
build step“ and Select “Execute HPE tests from file system“ option.
Enter the required details in the next screen about the UFT test

Set up the Post Build Actions


Select Post-build Actions Tab and click on the Add Post-build action
Select the Archive Option of your choice and click on ”Apply” and ”Save” your
settings

Run Job
Open Your Jenkins Project and click on “Build Now” options from the left
Check Result
You will see the job links in the Build history Section as above. Click on the link
and select Console Output.

S-ar putea să vă placă și