Selenium scripts in StormRunner Load

StormRunner Load supports Selenium, an open-source load testing framework.

Note: You can only run Selenium scripts on cloud based load generators and not on on-premises load generators.

 

Selenium using JUnit

System requirements

StormRunner Load supports the following:

SeleniumVersion 3.2.0
Browsers

Firefox 52

Chrome 56

JUnitVersion 4.12

Upload a Selenium script to StormRunner Load

  1. Create a storm.properties file that defines an execution type and entry point.

    The file is a standard Java properties file (key/value pairs). For example:

    execution=Selenium
    runner=junit
    entrypoint=scratch.UnitTestSample
    transactions=scratch.UnitTestSample.baseTest1,scratch.UnitTestSample.baseTest2
    KeyDescription
    executionThe execution engine type for the script.
    runnerThe name of the testing framework. By default, the runner is junit.
    entrypointThe entry for the testing framework. The entry point is the full class name of the Junit test entry . In the above example, it is scratch.UnitTestSample.
    transactions

    A list of transaction names, separated by commas, which are displayed on the Load tests > SLA page.

    Transaction names are in the format: <package name>.<class name>.<test method name>.

  2. Create a .zip file that contains the storm.properties file, your Selenium script (.jar) files and all other dependencies. The storm.properties file and the *.jar files must be located in the root folder of the .zip file.

    Tip: The required JUnit and Selenium frameworks are already deployed in StormRunner Load. You do not need to include these frameworks in the .zip file.

Transaction definition

Transactions defined in the storm.properties file will appear in the Load tests > SLA page.

Transactions are defined in the JUnit test framework and transaction names are in the format: <test class full name>.<test method>.

In addition, all tests in your Selenium script will be reported as transactions. During a test run, add transactions widgets for these transactions from the gallery to the dashboard to display real time data detailing the results of your load test.

Transaction names example:

Transactions are: “scratch.UnitTestSample.baseTest1” and “scratch.UnitTestSample.baseTest2”

transactions=scratch.UnitTestSample.baseTest1,scratch.UnitTestSample.baseTest2

JUnit Test java class example:

package scratch;

import org.junit.Test;

public class UnitTestSample {
      @Test
      public void baseTest1() {
          // The test method
      }

      @Test
      public void baseTest2() {
          // The test method
     }
}

Back to top

Selenium using Mocha

System requirements

StormRunner Load supports the following:

SeleniumVersion 3.2.0
Browsers

Firefox 52

Chrome 56

MochaVersion 5.2.0
Selenium WebDriver Version 3.3.0

Upload a Selenium script to StormRunner Load

  1. Create a storm.json file that defines an execution type and transactions. For example:

    {
        "execution": "Selenium",
        "runner": "mocha",
        "transactions": ["sample - test item 1", "sample - test item 2"]
    }
    
  2. Create an npm package that contains the storm.json file. For details on creating an npm package, see https://docs.npmjs.com/cli/pack.

  3. Upload the npm package (which is a .tgz file ) to StormRunner Load.

    Tip: The required Mocha and Selenium frameworks are already deployed in StormRunner Load. You do not need to include these frameworks in the .tgz file.

Transaction definition

Transactions defined in the storm.json file will appear in the Load tests > SLA page.

Transactions are defined in the Mocha test framework and transaction names are in the format: <test suite name>-<test item name>.

The example below includes one transaction called sample - test item:

describe('sample', function() {
     it('test item', function(done) {
        const driver = new Builder().forBrowser('chrome').build();
        setTimeout(() => {
            driver.get('https://software.microfocus.com');
            driver.quit();
            done();
         }, 1000);
     });
});

Back to top