ALM server occupies large space with many files named java_pidXXXX.hprof

The HPROF are files created as logs for the java virtual machine, they are created automatically by the server in the java virtual machine of ALM.
There was a reason for the server to be slow when these files are being created, because they are huge.
These files can simply be removed to reduce the disk occupation.
However, there’s an option to disable the heap dump file generation, but it is not suggested to do that.
For information how to disable the hprof files please type the sign # before in the wrapper.conf file.
The wrapper.conf file is located at ~\HP\ALM\wrapper

On the link below could be found more information about these files:


What is _system_user_ in ALM and how ALM uses this user

In the Site Administration database schema (the default name qcsiteadmin_db) in the SESSIONS_HISTORY table ALM uses “_system_user_” with a type of ALM Internal Server.

The _system_user_ is an internal user used by ALM with a type of “ALM Server Internal” in order to perform internal operations. It was introduced in ALM 11.

Any operations on ALM entities are monitored by the permissions granted to the user performing them and thus an internal user is needed. For example, QPM Calculation engine needs to access to different projects and entities.

Here are some characteristics for this user:
– It does not have a password and it is internal thus preventing login using this user.
– It does not consume a license. This is a user created for internal server jobs proposes.
– This user is created upon installation/upgrade process.
– It enables automatically on project creation, as part of the TDAmin group. This indicates that the user’s permissions are equal to regular admin user.
– The user is hidden from the Site Administrator’s users list and it does not appear as one of the users enabled on the projects. This is done to prevent deleting the user or changing its properties.
– The records on the user are stored inside the qcsiteadmin_db. If the user list is managed using LDAP, the user is not defined in it. Its scope is only inside ALM since it is not representing a normal user.

Run Appium scripts remotely using StormRunner Functional

This article describes how to set up your Appium environment and run tests remotely in the SRF environment lab.

Prepare your Appium environment

To prepare your environment to run an automated Appium test, you must first configure your working environment, such as Visual Studio or Eclipse, to recognize the Appium project.

Prepare your Appium test

Do the following to prepare your Appium test to run remotely in SRF:

1. In the code the starts the session, replace the Appium server URL and port with the SRF URL and port.

Use the following syntax:

driver = new AndroidDriver(new URL("" + "/wd/hub"), capabilities);
driver = new IOSDriver(new URL("" + "/wd/hub"), capabilities);

2. In the code that starts the session, add your SRF client ID and secret as capability code.

3. capabilities.SetCapability("SRF_CLIENT_ID", "<placeholder>");
capabilities.SetCapability("SRF_CLIENT_SECRET", "<placeholder>");

3. Make your apps available for the test by uploading them to SRF.

4. Modify your code for deprecated elements and methods

Beginning with version 1.6.3, Appium deprecated the following items: element for findElement. Make sure to modify your code accordingly.
scrollTo and scrollToExactmethods. Instead, use a driver. execute command, for example,
driver.execute('mobile: scroll', {element: el, toVisible: true})

5. Continue with Run your test.

Run your test

Run your test using the relevant steps for your testing tool:

Run your Appium test in Eclipse

To run your Appium test in Eclipse:

1. Open your project in Eclipse. Set the Appium capabilities as needed, including the server and device information.

2. Launch the test. Check the Eclipse console to ensure that your test is running properly.

Run your Appium test with Apache Ant

To run your Appium test with Ant:

1. Download and install Apache Ant, and set the required environment variables.

2. Open a command dialog box and navigate to your Appium workspace path.

3. Run the command ant <test_name>.java to start running your test.

Check the Ant console to ensure that your test is running properly.

Run a single job project in Jenkins

To run your Appium test as a Jenkins job: (Terminology refers to Jenkins 2.00 and higher):

1. Download and install Apache Ant, and set the relevant environment variables.

2. Open the Jenkins dashboard and click New item.

3. Specify an Item name and click Freestyle project.

4. In the General tab, click Advanced.

5. Select Use custom workspace and enter your Appium workspace path.

6. In the Build section, select Invoke ant.

7. Click the Advanced button. Provide a target name and the full path to the build.xml file in the Build Filefield.

8. Click Save.

9. On the project page, click Build Now.

Run a MultiJob project in Jenkins

To run multiple Appium tests as a Jenkins job: (Terminology refers to Jenkins 2.00 and higher):

1. Prepare several single job freestyle jobs.

2. Click New item and specify a MultiJob project.

3. In the Build section, select MultiJob Phase from the Add build step drop down. Enter a phase name.

4. Click Add jobs and select the first job you want to add. Repeat this step for all of the jobs you want to include in this phase.

5. Select an option from the Job execution type drop down: sequentially or in parallel.

If you are executing multiple jobs, but only have one device, the jobs will be executed sequentially—not in parallel.

6. Optionally, select a continuation condition, for example: Always, Successful, or Completed.

7. On the project page, click Build Now.

Tip: The udid, name, and platformVersion capabilities are optional. You can use the platformNamecapability alone, to instruct the Appium test to look for the next available device.

As your test runs, the device is locked and reserved by you in the SRF mobile lab.

The running tests icon in the upper right corner of SRF indicates that your test is running.

Retrieve Appium logs

A log file is generated while your Appium test runs.

To retrieve the log, use the mc-wd:downloadLogs script and specify the encoding.

When the connector receives this command, it retrieves the contents of the Appium log file for the current testing session, as a string. Attach the string to the response body.

The Appium user’s test code uses the string from the response body and processes it accordingly.

For example:

HashMap<String, String> encoding= new HashMap<String, String>();

encoding.put(“encoding”, “UTF-8”);

String logFileContents = (String) wd.executeScript(“mc-wd: downloadLogs”, encoding);

Run Selenium tests remotely using StormRunner Functional

This article describes how to run Selenium tests in SRF, remotely from your remote web driver.

SRF supports remote testing from Selenium in all languages supported by Selenium, including Java, C#, JavaScript, Python, Ruby, and more.

Run Selenium tests remotely: basic steps

Run your Selenium tests from your remote web driver as follows:

1. Add code to your tests to access SRF and to define your environment.

2. Add capability code to your tests to define SRF such as test tags, or the names displayed in test results, as well as environment settings.

3. Run your Selenium tests remotely in SRF using your remote web driver as you would other Selenium tests.

Run Selenium jUnit tests in Firefox

If you are running your jUnit test in Firefox, remotely in SRF, use the following firefox profile API:

FirefoxProfile firefoxProfile = new FirefoxProfile();

Run Selenium tests with enhanced reports

SRF reporters are available for several types of Selenium tests.

Select an option to modify the information displayed on this page:

Run JavaScript Selenium tests with enhanced reports

To run a JavaScript Selenium test with enhanced reports using SRF’s reporter, do the following:

a. Install the reporter:

b. Add the SRF_REPORTER_URL environment variable, and its value with the URL to your SRF tenant.

For example,, or, depending on your tenant region.

Tip: Alternately, pass the srfUrl reporter option from the command line.

3. Add and define the following environment variables:

SRF client ID and secret o SRF_CLIENT_ID


Proxy server If you are running the reporter from behind a firewall, define the following:



Note: When running your test, be sure to assign the client secret value to the SRF_CLIENT_SECRETenvironment variable.

4. Use one of the following commands when running your test:

Using the SRF_REPORTER_URL environment variable

For example:

mocha test-name.js –reporter srf.reporter.mocha

Using the srfURL reporter option

For example:

mocha test-name.js –reporter srf.reporter.mocha –reporter-options srfUrl=

Run Ruby tests remotely with enhanced reports

To use this feature, contact customer support to obtain the Ruby Selenium reporter.

Then, do the following to run a Ruby Selenium tests with enhanced reports:

1. Install the SRF reporter by running the following command:

gem install srfrubyreporter

2. Open and edit your Gemfile, and add the following line:

gem ‘srfreport’

3. Open and edit your *.rb file, and add the following line:

require ‘srfreport’

4. Continue with one of the following options:

o Run your Ruby test remotely from the command line

o Run your Ruby test using a remote driver

Run your Ruby test remotely from the command line

a. Add the following line to your *.rb file:

Capybara.default_driver = :srf_driver

b. Run your test from the command line with the following parameters, or define these as environment variables on your machine.

Name Value
SRF_REPORTER_URL The URL to your SRF tenant.

For example: or, depending on your region.



Your SRF client ID and secret values.
TEST_NAME The path to your test and your test name.

For example: “MyAdvantageRubyTest”

OS_NAME The operating system you want to use to run your test.
OS_VERSION The operating system version you want to use to run your test.
BROWSER_NAME The name of the browser you want to use to run your test.
BROWSER_VERSION The browser version you want to use to run your test.

c. For example:

d. bundle exec cucumber SRF_REPORTER_URL= SRF_CLIENT_ID=<placeholder> SRF_CLIENT_SECRET=<placeholder> TEST_NAME=”MyAdvantageRubyTest” BROWSER_NAME=chrome BROWSER_VERSION=65 OS_NAME=Windows OS_VERSION=10

Run your Ruby test using a remote driver

Run your Ruby test remotely using your own remote driver as follows:

1. Edit your test to include the following:

o Capability code as needed.

o The SRF_CLIENT_ID and SRF_CLIENT_SECRET values as environment variables.

For example:

Capybara.register_driver :my_driver do |app|
 caps =
 :platform => "Windows 10",
 :testName => "MyAdvantageRubyTest",
 :browser_name =>"chrome",
 :version => "65",
 :SRF_CLIENT_SECRET => ENV['<placeholder>'],
 :SRF_CLIENT_ID => ENV['<placeholder>']
 driver =, :browser => :remote, :url => ENV['SRF_REPORTER_URL'] + "/wd/hub", :desired_capabilities => caps)
Capybara.default_driver = :my_driver

2. Run your test from the command line, including the following parameters:

SRF_REPORTER_URL The URL to your SRF tenant.

For example: or, depending on your tenant region.



Your SRF client ID and secret values.

3. For example:


Run Java tests remotely with enhanced reports

To use this feature, contact customer support to obtain the Java Selenium reporter (srfRunner.jar).

Then, do the following to run a Java Selenium tests with enhanced reports:

1. Save the srfRunner.jar file on the computer where you are running your test.

o Use the file with dependencies if you want all libraries downloaded together.

o Use the file without dependencies if you already have required libraries stored locally, or can access them ad-hoc when running your test.

2. Update your test to define the relevant classes, options, and variables.

3. Run your Java test as you would otherwise.

Selenium code samples for remote testing

Selenium Java code sample

Prerequisites. Before running these code samples, replace the sample SRF_CLIENT_ID and SRF_CLIENT_SECRET values with your own SRF client secret values. If needed, update the SRF URL value to match that of your tenant region.

Sample without proxy

package DEMO.Selenium;
import static org.junit.Assert.*;
import java.util.concurrent.TimeUnit;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
 private static RemoteWebDriver driver;
 static DesiredCapabilities capabilities =;

public static void openBrowser() throws MalformedURLException{
 capabilities.setCapability("platform", "Windows 8.1");
 capabilities.setCapability("testName","Selenium Burst JAVA - Online Shopping");
 capabilities.setCapability("SRF_CLIENT_ID", "<placeholder>");
 capabilities.setCapability("SRF_CLIENT_SECRET", System.getenv("SRF CLIENT SECRET"));
 capabilities.setCapability("resolution", "800x600");

 driver = new RemoteWebDriver(
 new URL(""), capabilities);
 driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);}

public void OnlineShoppingE2E() throws InterruptedException{
 Actions builder = new Actions(driver);
 driver.findElement(By.xpath("//DIV[@id=\"mobileSearch\"]/INPUT[1]")).sendKeys("speakers"); //Search edit
 driver.findElement(By.cssSelector("#mobileSearch > #Layer_1")).click(); //Search button
 WebElement addToCartElement = driver.findElement(By.linkText("Bose Soundlink Bluetooth Speaker III"));;
 driver.findElement(By.xpath("//DIV[@id=\"productProperties\"]/DIV/BUTTON[normalize-space()=\"ADD TO CART\"]")).click(); //Add to cart button
 driver.findElement(By.xpath("//HEADER[1]/NAV[1]/UL[1]/LI[1]/A[1]")).click(); //Cart Icon
 assertEquals(driver.findElement(By.cssSelector("div#shoppingCart > table > tfoot > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)")).getText(), "$269.99"); //Checking item price

public static void closeBrowser(){

Sample with proxy

package com.microfocus.srf.pock;
import org.apache.http.HttpHost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CommandInfo;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.HttpCommandExecutor;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.internal.ApacheHttpClient;

public class FinalDocumentationExample
 {private WebDriver driver;
 public void openBrowser() throws MalformedURLException {
DesiredCapabilities capability =;
 capability.setCapability("SRF_CLIENT_SECRET", System.getenv("SRF CLIENT SECRET"));
 capability.setCapability("platform","windows 7");
 URL srfUrl =new URL("https","",443,"/wd/hub/");

 System.out.println("Creating remote web driver with address: "+ srfUrl);

 HttpCommandExecutor executor =new HttpCommandExecutor(new HashMap<String, CommandInfo>(), srfUrl,new HttpClient.Factory()
 public HttpClient createClient(URL url){
 HttpClientBuilder builder = HttpClientBuilder.create();
 HttpHost driverProxy =new HttpHost("<proxy host placeholder>",<proxy port placeholder>);
 return new ApacheHttpClient(, url);
 driver =new RemoteWebDriver(executor, capability);
public void closeBrowser() throws IOException {
public void pageTitleAfterSearchShouldBeginWithDrupal() throws IOException, InterruptedException {
 driver.get("");//type search query
 driver.findElement("q")).sendKeys("qa automation\n");// click search

Selenium JavaScript code sample

Prerequisites. Before running this code sample:

1. Install the following components on your machine:

o Node JS (

o Mocha (

· Selenium-webdriver (

2. Replace the sample SRF_CLIENT_ID and SRF_CLIENT_SECRET values with your own SRF client values.

3. If needed, update the SRF URL value to match that of your tenant region.

4. If you are working behind a firewall, uncomment the proxy code and add your proxy access details.

var webdriver = require('selenium-webdriver'),
proxy = require('selenium-webdriver/proxy');
By = webdriver.By,
until = webdriver.until;
var assert = require('selenium-webdriver/testing/assert');
var driver;
describe('DEMO Online Shopping Selenium', function () {
 var capabilities = {
 platform: "Windows 8.1",
 browserName: "chrome",
 //version: "58",//Instead of specific version number you can specify latest version:
 version: "latest",
 testName: "Demo_Burst_Test_Selenium_JS",
 resolution: "800x600",
 //NOTE: Web AUT which is tested in this test changes it's UI elements dependents on resolution, in case if you will use higher resolution test will fail//Supported resolutions are: 800x600; 1024X768; 1280X1024
 SRF_CLIENT_ID: "<placeholder>",
 driver = new webdriver
 driver.get('').then(function() {
 console.log("open Online Shopping web page");

 it('should search required category', function (done) {
 .wait(until.elementLocated(By.xpath("//DIV[@id=\"mobileSearch\"]/INPUT[1]"), 5000))
 .then(()=>driver.findElement(By.css("#mobileSearch > #Layer_1")).click())

it('should click on "Bose Soundlink Bluetooth Speaker III" in list of founded items', function (done) {
 var element = driver.findElement({partialLinkText:"Bose Soundlink Bluetooth Speaker III", tagName:'LI'});

it('should add item into the cart',function(done){
 .wait(until.elementLocated(By.xpath("//DIV[@id=\"productProperties\"]/DIV/BUTTON[normalize-space()=\"ADD TO CART\"]"), 5000))
 .findElement(By.xpath("//DIV[@id=\"productProperties\"]/DIV/BUTTON[normalize-space()=\"ADD TO CART\"]"))

it('should click on cart icon',function(done){

 it('should check item price',function(done){
 var itemPrice = driver.findElement(By.css("div#shoppingCart > table > tfoot > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)"));

 it('should click on checkout button',function(done){

 it('should fill existing user details',function(done){

 it('should click login button',function(done){

 it('should check total price',function(done){
 var totalPrice = driver.findElement(By.css("div#userCart > div:nth-child(5) > label:nth-child(2) > span"));

 it('should click next button',function(done){

 it('should specify user details for buying items',function(done){

 .findElement(By.xpath("//DIV/SEC-FORM/SEC-VIEW/DIV/LABEL[normalize-space()=\"SafePay username\"]"))
 .findElement(By.css("div#paymentMethod > div > div:nth-child(3) > sec-form > sec-view:nth-child(1) > div > input"))
 .findElement(By.xpath("//DIV/SEC-FORM/SEC-VIEW/DIV/LABEL[normalize-space()=\"SafePay password\"]"))
 .findElement(By.css("div#paymentMethod > div > div:nth-child(3) > sec-form > sec-view:nth-child(2) > div > input"))

 it('should uncheck checkbox "save cahnges to profile"',function(done){
 if (elementSelectedState)

 it('should click on "Pay now" button',function(done){

 it('should check price in order details',function(done){

 var totalPrice = driver.findElement(By.css("div#orderPaymentSuccess > div > div:nth-child(3) > div:nth-child(4) > label > a"));


Selenium C# code sample

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System.Configuration;
using System;
using OpenQA.Selenium.Remote;
using System.Threading;
using OpenQA.Selenium.Interactions;
using NUnit.Framework;
namespace SeleniumExample
 public static class WebElementExtensions
 public static bool ElementIsPresent(this IWebDriver driver, By by)
 var present = false;
 present = driver.FindElement(by).Displayed;
 catch (NoSuchElementException)
 return present;
 [TestFixture, Category("Selenium_C#")]public class DEMO_Online_Shopping
 DesiredCapabilities dc;
 RemoteWebDriver driver;
 public void Init()
 dc = DesiredCapabilities.Chrome();
 dc.SetCapability("platform", "Windows 8.1");
 dc.SetCapability("testName", "Selenium Burst C# - Online Shopping");
 dc.SetCapability(CapabilityType.Version, Environment.GetEnvironmentVariable("SRF_Browser_Version"));
 dc.SetCapability("resolution", "800x600");
 dc.SetCapability("SRF_CLIENT_ID", "<placeholder>");
 dc.SetCapability("SRF_CLIENT_SECRET", "<placeholder>");
 driver = new RemoteWebDriver(new Uri(""), dc);
  //driver = new ChromeDriver();
 [Test]public void Demo_Online_Shopping()
 Actions builder = new Actions(driver);
 driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 0, 10)); // 10 seconds for searching objects
 driver.FindElement(By.XPath("//DIV[@id=\"mobileSearch\"]/INPUT[1]")).SendKeys("speakers");  //Search edit
 driver.FindElement(By.CssSelector("#mobileSearch > #Layer_1")).Click(); //Search button
 IWebElement addToCartElement = driver.FindElement(By.LinkText("Bose Soundlink Bluetooth Speaker III"));
 driver.FindElement(By.XPath("//DIV[@id=\"productProperties\"]/DIV/BUTTON[normalize-space()=\"ADD TO CART\"]")).Click(); //Add to cart button
 driver.FindElement(By.XPath("//HEADER[1]/NAV[1]/UL[1]/LI[1]/A[1]")).Click(); //Cart Icon
 Assert.AreEqual(driver.FindElement(By.CssSelector("div#shoppingCart > table > tfoot > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)")).Text, "$269.99"); //Checking item price
 [OneTimeTearDown]public void TearDown()

Record and run LeanFT tests remotely using StormRunner Functional

This article describes how to record and run your LeanFT test remotely in your SRF lab.

Configure the connection to SRF

To configure the connection from LeanFT to SRF:

1. On the SRF settings page, generate a client ID and secret to use when accessing SRF.

2. In LeanFT, open your LeanFT Runtime Engine Settings dialog box, and select the Labs tab.

Define your SRF settings under StormRunner Functional Settings.


Define your settings as follows:

Server address The URL of your SRF tenant.

For example:

Client ID / Client secret The client ID and secret you generated to connect to SRF.
Use proxy Select to use a proxy to access SRF, and then also define your proxy settings in the fields below.
Do not validate certificate By default, LeanFT employs Full SSL (Strict). Select this option to ignore certificate errors.
Show remote access window when a mobile test runs Select to enable watching your test runs on the mobile devices in the SRF remote access window.

Note: If you select this option, and your device connector uses a self-signed certificate, then the first time a test runs you will receive the following certificate message:

The attempt to connect to <connector URL> has failed

To fix this issue, add the connector’s self-sign certificate to your machines trusted certificate storage.

After configuring your certificate you should restart the LeanFT engine.

Click Verify to check your connection.

Edit your LeanFT test

Edit your test to enable running it in SRF.

Specifically, modify your test script so that it launches browsers and locks mobile devices that are allocated by SRF in the cloud, rather than local browsers and devices.

Use the following when editing your test:

SrfLab class

Use the SrfLab class to launch your browser or lock a mobile device in SRF.

Provide the SrfLab class with description objects for your browser or device, defining the capabilities you would like to use as your test environment.


Use the LeanFT SDKs to define your test object and write your script, just as you would when running a test locally.

Supported capabilities for LeanFT

Use capability code to define SRF feature values, such as test tags, or the names displayed in test results, as well as environment settings.

Releasing SRF environments

We recommend calling the releaseEnvironment method of the SrfLab class at the end of your test to unlock a device and release the browser environment.

Add visual testing steps

Integrate your LeanFT test with both SRF and Applitools.

To do this, add code as needed to define your Applitools visual testing steps and environment variables.

Design mobile tests on SRF mobile devices

Use LeanFT’s Test Recorder and Object Identification Center on mobile apps, on SRF-provisioned mobile devices.

Make sure that the connection between LeanFT and SRF is configured.

1. From your IDE menu, click LeanFT > Launch a StormRunner Functional Device.

The SRF Mobile Lab window opens.

2. Select the device on which you want to spy or record.

Once selected, the device will be locked.

3. To spy, open the required app on the device (or install it if it is not already installed). You can start recording either before or after you open the app.

4. From your IDE menu, open the Object Identification Center or Test Recorder and use them as you would typically.

5. When you are done using the device, close the Mobile Lab window to release the device.

While the device is locked, you can run your test on it for debugging purposes. A run report will be created in LeanFT, but will not be created in SRF.

Run your test and view results

Run your test in SRF just as you would locally.

Snapshots in run results are affected by snapshot levels set in the script, as for other LeanFT tests.

Test results are displayed both in the LeanFT run report, and in SRF.

LeanFT code samples for remote testing

LeanFT Java code samples

Launch the latest version of Chrome in a Windows 7 machine

Browser browser = SrfLab.launchBrowser(BrowserType.CHROME);

Launch IE 11 on a Windows 10 machine and set the SRF test name to be shown in the RESULTS tab

· Provide a predefined object:

BrowserDescription bd = new BrowserDescription();

bd.setType(BrowserType.INTERNET_EXPLORER); //or: bd.set(“type”, BrowserType.INTERNET_EXPLORER) or: bd.set(“type”, “INTERNET_EXPLORER”)

bd.set(“version”, “11”);

bd.set(“osType”, “Windows”);

bd.set(“osVersion”, “10”);

bd.set(“testName”, “My LeanFT web test”);

Browser browser = SrfLab.launchBrowser(bd);

· Define capabilities using the Builder syntax:

Browser browser = SrfLab.launchBrowser(new BrowserDescription.Builder().type(BrowserType.INTERNET_EXPLORER).set(“version”, “11”).set(“osType”, “Windows”).set(“osVersion”,”10″).set(“testName”, “My LeanFT web test”).build());

Lock a device in SRF

· Provide a predefined object:

DeviceDescription dd = new DeviceDescription();

dd.setOsType(“Android”); //or: dd.set(“osType”, “Android”)

dd.setOsVersion(“5.02”); //or: dd.set(“osVersion”, “5.02”)

dd.set(“testName”, “My LeanFT mobile test”);

Device device = SrfLab.lockDevice(dd);

· Define capabilities using the Builder syntax:

Device device = SrfLab.lockDevice(new DeviceDescription.Builder().osType(“Android”).osVersion(“4”).set(“testName”,” My LeanFT mobile test”).build());

· Define capabilities in the SrfLab class, calling previously mapped properties:

Map<String, Object> props = new HashMap<>();

props.put(“osType”, “Android”);

props.put(“osVersion”, “5.02”);

props.put(“testName”, ” My LeanFT mobile test “);

Device device = SrfLab.lockDevice(DeviceDescription.fromMap(props));

Launch a browser in an SRF mobile device

First, lock an SRF device, and then launch your browser by passing the device object to theBrowserFactory.launch method.

Browser browser = BrowserFactory.launch(BrowserType.Chrome, device);

Release the SRF environment at the end of your test

· Release a web environment


· Unlock a device


LeanFT JavaScript code samples

Launch the latest version of Chrome in a Windows 7 machine

LFT.SrfLab.launchBrowser(“Chrome”).then(function (b) { //or: Web.BrowserType.Chrome instead of “Chrome”

browser = b;


Launch IE 11 on a Windows 10 machine and set the SRF test name to be shown in the RESULTS tab


type: Web.BrowserType.IE, //or: type: “IE”

version: “11”,

osType: “Windows”,

osVersion: “10”,

testName: “My LeanFT web test”

}).then(function (b) {

browser = b;


Lock a device in SRF


osType: “Android”,

osVersion: “5.02”,

testName: “My LeanFT mobile test”

}).then(function(d) {

device = d;


Release the SRF environment at the end of your test

· Release a web environment


· Unlock a device


Full test – Advantage Online Shopping

The following example tests the Advantage Online Shopping site.

var LFT = require('leanft');
var SDK = LFT.SDK;
var Web = LFT.Web;
var whenDone = LFT.whenDone;
var expect = require('leanft/expect');
describe('Example of LeanFT execution burst test in SRF', function () {
 var browser;
 before(function (done) {
 beforeEach(function (done) {
 //The following are examples of available capabilities when launching a browser in SRF.
 osType: "windows",
 osVersion: "8.1",
 type: "chrome",
 //version: "58",//Specify a specific number or define as the latest version, as follows:
 version: "latest",
 release: "0.95",
 build: "1234",
 screenResolution: "800x600",
 testName: "Demo_Burst_Test_LeanFT_JS"
 .then(function (b) {
 browser = b;
 it('should validate the price of the chosen item', function (done) {
 var searchAdvantageonlineshopping = browser.$(Web.Edit({
 name: "WebEdit",
 tagName: "INPUT",
 type: "text"
 var boseSoundlinkBluetooth = browser.$(Web.Link({
 tagName: "A"
 var itemPrice = browser.$(Web.Element({ xpath: "//DIV[@id="Description"]/H2[1]", className: "roboto-thin screen768 ng-binding", tagName: "H2" }));
 //Sample checkpoint (expects) validation:
 afterEach(function (done) {
 if (browser) {
 after(function (done) {

LeanFT C# code samples

Release the SRF environment at the end of your test

· Release a web environment


· Unlock a device


Full test – Advantage Online Shopping

The following example tests the Advantage Online Shopping site using the LeanFT NUnit3 template.

using System;
using NUnit.Framework;
using HP.LFT.SDK;
using HP.LFT.Verifications;
using HP.LFT.SDK.Web;
using System.Text.RegularExpressions;
namespace LeanFtTestProject1
 public class LeanFtTest : UnitTestClassBase
 static BrowserDescription brDesc;
 static IBrowser browser;
 String categoryToFind = "speakers";
 String itemToFind = "Bose Soundlink Bluetooth Speaker III";
 String expectedPrice = "$269.99";
 static String userName = "<username>";
 static String userPassword = "<password>";
 [OneTimeSetUp]public void TestFixtureSetUp()
 var brDesc = new BrowserDescription();
 //example of the different capabilities that can be used when launching a browser in SRF.
 brDesc.Type = BrowserType.Chrome;
 brDesc.Set("version", "58");
 brDesc.Set("osType", "windows");
 brDesc.Set("osVersion", "8.1");
 brDesc.Set("release", "0.95");
 brDesc.Set("build", "1024");
 brDesc.Set("testName", "LeanFT Burst C# Online Shopping");
 brDesc.Set("resolution", "800x600");

 browser = SrfLab.LaunchBrowser(brDesc);
 [SetUp]public void SetUp()
 // Before each test
 [Test]public void ValidatePriceOfChosenItem()

 browser.Describe<IEditField>(new EditFieldDescription
 Type = @"text",
 Placeholder = @"Search",
 TagName = @"INPUT",
 Name = @"WebEdit"

 browser.Describe<IWebElement>(new WebElementDescription
 AccessibilityName = string.Empty,
 TagName = @"svg",
 InnerText = string.Empty,
 Index = 10

 browser.Describe<IWebElement>(new WebElementDescription
 TagName = @"A",
 InnerText = "Bose Soundlink Bluetooth Speaker III"

 String itemPrice = browser.Describe<IWebElement>(new WebElementDescription
 XPath = @"//DIV[@id=""mobileDescription""]/H2[1]",
 ClassName = @"roboto-thin ng-binding",
 TagName = @"H2"

 Assert.AreEqual("$269.99", itemPrice);
 public void TearDown()
 // Clean up after each test
 [OneTimeTearDown]public void TestFixtureTearDown()
 // Clean up once per fixture

Record and run UFT tests remotely using StormRunner Functional

This article describes how to record and run your UFT test remotely using your SRF lab.

Configure the connection to SRF

Ensure that you have a valid connection to the SRF lab before running your Web or Mobile tests remotely.

Do the following:

1. On the SRF settings page, generate a client ID and secret to use when accessing SRF.

2. In UFT, browse to the StormRunner Functional pane in the Options dialog box (Tools > Options > GUI Testing > StormRunner Functional).

3. Enter the values for your SRF access, as well as proxy access as needed. Use the client ID and secret values you generated in SRF.

4. Click Test Connection to verify that your details are correct.

Define the Record and Run settings

Open your test, and define the Record and Run Settings on the Web or Mobile tabs.

Define settings to perform Web testing

1. On the Web tab, select Open the following when recording or running, and then select Use: Micro Focus SRF.

For example:


2. Define the URL you want to open in the SRF lab, the tunnel you want to use if needed, and your test environment.

3. (Optional) Data drive your tests during runtime by modifying browser and device values for each test iteration.

Define your settings to perform Mobile device testing

1. On the Mobile tab, select Use StormRunner Functional.

For example:


2. Define your test device as follows:

o Under Device Capabilities, define the capabilities you require so that SRF can find a device for you.

o Under Specific Device, select a specific device from the SRF lab.

3. Under App Settings, do the following:

o Select the apps you need for your test.

o Define whether you want the selected apps to be installed and restarted before each test run, and uninstalled at the end.

· Define which app you want to launch at the start of your test.

4. If you are testing on a web browser, define additional settings on the Web tab, including a URL to open at the start of your test, and any parameterization details needed.

Record a UFT mobile test remotely

Remote recording is supported for mobile devices only. To record your mobile test, do the following:

1. Configure your Record and Run Settings for mobile testing in SRF.

2. Click Record on the UFT toolbar to start recording.

A mobile device from the SRF mobile lab is shown in the remote access window.

3. Perform actions on the mobile device to record your test.

4. Click Stop when you’re done to stop recording. Your test is saved in UFT.

The remote access window remains open after you finish recording so that you can continue to spy and add objects to your test’s object repository. The remote access window will lose connectivity with the device after 15 minutes of inactivity.

Note: If you update your Record and Run Settings and start recording on a second device, the remote access window with the first device is closed, and then device is released.

Run UFT tests remotely

After configuring your Record and Run Settings, run your tests as you would otherwise.

Data drive your tests during runtime

Data drive your tests during runtime by modifying browser and device values for each test iteration.

In the Web tab of the Record and Run Settings dialog:

1. Select Parameterize runtime web settings using.

2. Define your parameter value location:

o GlobalData Table. For global parameters, defined in the Data table.

o Test Parameter. For test parameters, defined in the Properties pane.

3. Define the name of the parameter used to define the browser. (Default = Browser)

4. Prepare the parameter values in your selected location.

Note: Some mobile testing and device parameters may not be pre-defined in your data table.

In such cases, add these parameter columns manually.

SRF parameter values

The following table describes the supported parameters used when data driving your test remotely in SRF.

Browser Mandatory. One of the following:



· IE

· MOBILE_CHROME for the native Chrome browser on Android.

· MOBILE_SAFARI for the native browser on iOS.

browser_identifier One of the following:

· com.hp.mobileweb. Uses the Mobile Web app

· Leave this value blank to use a native mobile browser, and then also set the device_ostype parameter.

This enables Mobile Center to automatically define the browser identifier.

Browser_version N/A for mobile devices.

For desktop browsers, one of the following:

· A browser version number.

· latest, or leave this value blank to use the latest version available.

device_manufacturer Defines the device manufacturer.

Enter a value only when testing on mobile devices. Leave this value blank to use any device available.

device_model Defines a device name, and must be one of those listed in the Device dropdown list in the Record and Run Settings dialog box.

Enter a value only when testing on mobile devices. Leave this value blank to use any device available.

device_ostype One of the following:

· Android

· iOS

Mandatory if the Browser value is set to MOBILE_HPEWEB.

Enter a value only when testing on mobile devices. Leave this value blank to use any device type available.

device_osversion Defines the device’s operating system version. Leave this value blank to use any device OS version available.
host Defines the device ID, as defined in Mobile Center. Required for running the test on mobile devices (as opposed to on the Chrome emulator).
OS Mandatory for desktop web testing, N/A for mobile devices.

One of the following:

· Windows 7

· Windows 10

· Windows 8.1

· Ubuntu 16.04

Resolution N/A for mobile devices.

One of the following:

· 1024×768

· 800×600

· 1280×1024

· 1366×768

· 1600×900

· 1920×1080

Leave this value blank to use the default resolution (1024×768).

Target Enter SRF to use StormRunner Functional when you run your test.

Leave this value blank to run your test locally or using Mobile Center.

Tunnel_name If you need a tunnel to connect to your application from SRF, enter the tunnel name as shown in SRF.

Note: Use only one tunnel per test. Switching tunnels between iterations in the same test may cause unexpected behavior.

Record Scripts using StormRunner Functional

This article describes how to record new scripts in SRF to use in your modular automation tests.

Record Script

If you are starting from the AUTOMATION tab, first create a test, and click the SCRIPTS tab on the right.

Then, do the following:

1. Click RECORD.

If you’ve started from the SCRIPTS tab, select WEB or MOBILE APPS.

Tip: To record a web script on a mobile device, select WEB.

This enables you to record and run on both desktop and mobile device browsers.

A remote access window opens for your recording session, with a popup to show the environment.

In the popup, click EDIT to change your environment settings.

2. Click to start your session. Use the toolbar buttons to manage your recording and add testing elements.

Tip: If you are testing a mobile device, use the CONTROL PANEL options on the left to interact with your device.

For example, change your orientation, zoom in and out of your device, or send text to your device.

3. When you’re finished recording, click STOP .

4. Enter your script name and save your script.

SRF displays your script, where you can make edits or return to recording.

5. To complete your recording session, click EXIT, and save your script with a meaningful name.

Recording toolbar reference

Use the toolbar buttons to do the following:

Pause your session if you need to take a break or make changes in your application that you do not want recorded.

Click to start recording again.

Stop your recording to fully stop and switch to the code view of your recorded test.

Click to start recording again.

Add checkpoints.
Add an Applitools visual testing step.
Display the recorded code.
Toggle the SRF clipboard on or off.

Use the SRF clipboard when you want to copy text from outside your recording to inside the remote viewer, or from inside the remote viewer to a local file.

For example, to copy your website URL to the browser window SRF, do the following:

1. Copy the URL from your local desktop.

2. In SRF, click the Toggle Clipboard button.

3. Paste the URL into the SRF clipboard field that appears.

4. Click the browser in the recording window to ensure that it’s in focus.

5. Click the Copy to clipboard button to paste it into the address bar.