⬆️ ⬇️

Run HP ALM tests using Jenkins

In today's IT world, it is very hard to imagine projects that would not use the Continues Integration server to automatically build and run tests. What if we use HP Application Lifecycle Management? How to be in this case? How do we, for example, run tests from Jenkins? People who are not familiar with this product may, at first glance, come to the conclusion that HP ALM does not have the ability to integrate with CI servers.



In fact, it is not. Integration with CI servers to run HP ALM tests is. To do this, simply install the HP Application Automation Tools plug-in for Jenkins.



Currently, this plugin can work with the following HP products:





Plug-in installation



To install the plugin you first need to download the latest version . And then go to Manage Jenkins -> Manage Plugins and install the plugin from the downloaded file. After the installation is complete, you can proceed with the configuration.

')









Plugin Setup



To configure, go to Manage Jenkins -> Configure System.







We are looking for the Application Lifecycle Management section there and click the Add ALM Server button. We enter the necessary alias for the server that Jenkins will use to identify the ALM server, as well as the URL of this server.







Jenkins jobs configuration



After we have done all the preliminary work, we can proceed with the configuration of Jenkins jobs to run automated tests directly. For example, consider how to configure job to run normal test sets (the so-called Client Side Execution) and to perform functional test sets (Server Side Execution) using ALM Lab Management.



Configure job to perform the usual test set. To do this, in the newly created Jenkins job we add the build step “Execute HP functional test from HP ALM”.







After we selected it, it is necessary to configure and fill in all the required fields, such as:









I would like to draw attention to the Test sets field, because it is not immediately clear what values ​​should be entered. In order to indicate which test set or test sets will be executed, you must open ALM and enter the project from which the tests will run. Going to the “Test Lab” module, we are looking for the test sets we need and remember the path to them from the Root folder.



For example, we want to find ways to the following test sets “Mercury Tours Sanity” and “Mercury Tours UI”. To do this, just look at the folder tree and bring this hierarchy to the Jenkins job, using “\” as a separator.











I would also like to mention the possibility of specifying where to run this test set using the “Run mode” option. This option allows you to select one of 3 places: on the local machine, on the machine (s) specified in the test set parameters, or on a specific the machine that will be passed as the Jenkins job parameter. That's where all the necessary setup for running regular test sets ends. Let's proceed to launch setup via Lab Management (functional test sets).



HP ALM Lab Management allows you to manage resources, hosts and timeslots, as well as everything you need to run automated tests (both functional and performance tests).



The process of setting this build step is very similar to the previous one, except for some features. For example, we don’t pass the path to the test set, but the ID, which makes it hard not to bind to the place where this test set is located. And also we have to pass the time for which we reserve timeslots in ALM (in fact, this is reservation of necessary resources, hosts and everything that is needed to complete this functional test set).



Where can I get the ID of the functional test set? The answer is obvious, in the ALM - Test Lab module.







Having filled in the necessary data we will get approximately the following picture:







Actually with the configuration that's all. Let's see which console log we get in the event of a launch (for example, take the last configured test set):







The console log is quite informative and contains a lot of information about the running test set. In case you need to get more information, you can open the report by clicking on the links in the log, which is quite convenient.



As we can see from the log, the test set is still running. Let's check in HP ALM that it really started. Open HP ALM and go to the Testslot module. There we see that a timeslot has been created for the needs of the functional test set:







Afterword



In this article, we looked at how to configure and run 2 types of test sets. And as we can see, running HP ALM tests / test sets using Jenkins is easy and simple. I would like to note that the HP Application Automation Tools plugin is open source, and anyone can contribute to its development.



To get more information about this plugin and its use, for example, with performance tests or UFT / QTP tests, you can go to the official page .



Publication author: Artem Grekul, leading specialist of the HP ALM testing group

Source: https://habr.com/ru/post/260331/



All Articles