This section walks you through integrating Perfecto Appium and Selenium scripts with Micro Focus LoadRunner. A sample LoadRunner project, including
.jar files for all dependencies and a sample script, is available here: https://github.com/PerfectoMobileSA/LoadRunnerSample
The integration with LoadRunner requires:
- A 32-bit JDK version for the LoadRunner support of Java Vusers. For example, LoadRunner 12.60 work with JDK 1.8. See the latest release notes here: https://admhelp.microfocus.com/lr/en/12.60-12.63/help/WebHelp/Content/WelcomeContent/c_WhatsNew.htm
- An installation of LoadRunner. You can download from this link: https://www.microfocus.com/en-us/products/loadrunner-load-testing/download
- To explore LoadRunner with Java, the
.jarfiles for all dependencies. LoadRunner does not support Maven or Gradle. Dependencies are available here: https://github.com/PerfectoMobileSA/LoadRunnerSample/tree/master/Dependencies
- A sample script,
Actions.java, available here: https://github.com/PerfectoMobileSA/LoadRunnerSample/blob/master/Perfecto_Appium_Example/Actions.java
The complete solution is available here: https://github.com/PerfectoMobileSA/LoadRunnerSample
Click a step to view details.
- Open the Virtual User Generator.
- Create a new script:
In the Create a New Script dialog, select Java Vuser. If you have provided the correct dependencies, this allows you to run any
On the Actions.java tab that opens, you should see the class populated with some stubs. In our case, we want to put all our Selenium/Appium code in
- Test the script, as follows:
- Click the run button to test the script. If the script passes, continue with step 5.
- If any compile errors occur, most likely your JDK is not set up correctly. In this case, do the following:
Open the sample script and copy its content.
On the Actions.java tab, paste the content of the sample script to replace the existing content.A word on imported packages
import lrapi.lr; - Loadrunner method that allows you to add transaction timers. This is critical to having the logical steps added in the LoadRunner report. Example:
You can add transactions to LoadRunner by doing any of the following:
(Recommended) Using method
This grabs the UX timer from the Perfecto API and utilizes
lr.set_transaction(timerName, timeEx, lr.PASS);to input a transaction in LoadRunner.
This adds a transaction entry in the LR report.
- Add the Selenium and Appium dependencies, as follows:
On the Runtime Settings tab, add the
.jarfiles that contain all the dependencies.
Save the script and run it again.
It should open the Perfecto UI to show the test run in the Test Analysis view.
When done, you should see the "Script Passed" message.
Open LoadRunner Controller and import the script you created.
- Modify the settings as needed and click the run button at the top left.
- When the run is complete, click Results > Analyze Results.
- In the LoadRunner Analysis Summary, view the transactions displayed.