NeoLoad for Appium
This section guides you through setting up the integration between Perfecto and NeoLoad for running Selenium/Appium scripts.
Watch this video to see a demo of the integration setup. Detailed steps follow.
Step-by-step instructions
Click a step to view details.

- Download and install Neoload.
- Do one of the following:
- Import the sample Neoload project or open it if you have already imported it.
- Create your own project, as follows:
- On Windows only: Install Cygwin and append its
bin
, normally present underC:\cygwin64\bin
, to the environment variables’ PATH variable. - Perform the following based on your platform:
-
In the
custom-resources
folder of the NeoLoad project path, create a file calledNL_Shell.sh
and add the following content:Copycd {MAVEN_PROJECT_PATH}
{MAVEN_PATH}/mvn clean install -Dnl.selenium.proxy.mode=EndUserExperience -Dnl.data.exchange.url=http://localhost:7400/DataExchange/v1/Service.svc/ - Dtestngxml=testng_web_neoload_Desktop_Web_1.xml -Dreportium-job-name=NEOLOAD -Dreportium-job-number=1 -Dreportium_job_tags=demoWhere:
-
{MAVEN_PROJECT_PATH}
should be replaced with the Maven project path. -
{MAVEN_PATH}
should be replaced with the path to the.mvn
file. -
Reporting-related parameters are optional and enable integration with the Perfecto Smart Reporting CI Dashboard.
Note:For the end-user experience test, the device and number of virtual users should be
1
. Make sure that{testngxml}
has one device enabled and the project is able to run parallel tests.CopyMac example shell script
cd /Users/<user-name>/eclipse-workspace/PerfectoNeoLoadJavaMaven
/usr/local/Cellar/maven/3.6.0/bin/mvn clean install -Dtestngxml=testng_web_neoload_Desktop_Web_1.xml -Dreportium_job_name=NeoLoadDemo -Dreportium_job_num=65 -Dreportium_job_tags=demoCopyWindows example shell script
#!/bin/bash
cd /cygdrive/c/<<user>>/Workspace/PerfectoNeoLoadJavaMaven
C:/<<user>>/Tools/apache-maven-3.6.3/bin/mvn clean install -Dtestngxml=testng_web_neoload_Desktop_Web_1.xml -Dreportium_job_name=NeoLoadDemo -Dreportium_job_num=65 -Dreportium_job_tags=demo
-
-
Create a population and set the desired user path.
-
In NeoLoad, select Runtime, set the duration policy to By Iteration, and set both the initial number of users and the maximum number of users to 1 for any load variation policy.

To integrate NeoLoad with the Maven project, you can either use our sample Maven project or your existing Maven framework.

- Access the project on GitHub: https://github.com/PerfectoCode/Community-Samples/tree/master/PageLoadTimeSampleNeoLoad
-
In the NeoLoadPerfecto file, update your
HOST
andSECURITY_TOKEN
.To generate a security token
-
In the Perfecto UI at <YourCloud>.app.perfectomobile.com (where YourCloud is your actual cloud name, such as mobilecloud), click your user name and select My security token.
-
In the My security token form, click Generate Security Token.
-
Click Copy to clipboard. Then paste it into any scripts that you want to run with Perfecto.
- Click Close.
-

Edit the pom.xml
file as follows:
-
Add repository details to the
<repositories>
section:Copy<repository>
<id>neotys-public-releases</id>
<url>http://maven.neotys.com/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository> -
Add the following Maven dependency:
Copy<dependency>
<groupId>com.neotys.selenium</groupId>
<artifactId>neotys-selenium-proxy</artifactId>
<version>2.1.0</version>
</dependency> -
In the String variable, add the path to the NeoLoad project, as follows:
Copyfinal String projectPath = "/Users/admin/neoload_projects/NewSample/NewSample.nlp";
-
Create the NL driver and assign the created Perfecto driver instance, as follows:
Copythis.driver = NLWebDriverFactory.newNLWebDriver(pDriver, "seleniumUserPath", projectPath);
where:
-
pDriver
is the Perfecto driver with given capabilities (Mobile or Web). -
seleniumUserPath
is the String variable to retrace results in the NeoLoad controller. -
projectPath
is the Neoload project path to send runtime user experience data.
NLDriver is an extended Selenium driver provided by NeoLoad with extended methods. The driver fetches runtime user experience data and sends it to the NeoLoad controller via a callback URL.
-
-
Call the
startTransaction()
andstopTransaction()
methods of NeoLoad as follows:Copydriver.startTransaction("home1");
driver.get("http://ushahidi.demo.neotys.com/");
driver.stopTransaction();
driver.startTransaction("reports");
driver.findElement(By.id("mainmenu")).findElements(By.tagName("a")).get(1).click();
driver.stopTransaction();

To run tests in parallel, you can create several user paths with different shell files highlighting the testng.xml
file (-DtestngXmlFile=testng_web_neoload_Desktop_1.xml
), along with different populations. The following sample user paths and populations for executing 3 different testng.xml
files run on 3 different platforms in parallel.
User paths:
Populations:
shell.sh
: