Test run considerations for JMeter tests

Before you can run JMeter tests on HCL OneTest Server, you must read the considerations that you must take into account and complete the tasks indicated.

Before you run JMeter tests that you create in JMeter, you must have completed the following tasks:
  • You must ensure that the JMeter extension on HCL OneTest Server is enabled. You must enable the JMeter extension either at the time of installation of the server software or before you add the repository that contains JMeter tests to the server project. See Enabling server extensions.
  • You must have committed the following JMeter assets or resources as a JMeter project to a remote Git repository:
    Note: You must have created a project directory and added the associated tests or assets in sub directories, that might be required for the JMeter tests to run successfully.
    • The jmeterRoot.jprj project file in the project directory.
    • The JMeter tests in a sub directory with a name you provide within the project directory.
    • Optionally, the Java Key Store that is required at test run time in the certs sub directory.
    • Optionally, the JMeter properties files that are required at test run time in the properties sub directory.
    • Optionally, the library jar files that are required at test run time in the lib sub directory.
    • Optionally, the test dependencies that are required at test run time in the deps sub directory.
    For example, the project directory can be myproject that contains the jmeterRoot.jprj project file. In the project directory, you can create the following sub directories:
    • The mytests sub directory that contains the JMeter tests.
    • Optionally, the certs sub directory that contains the Java Key Store.

      For example, the path to the key store can be specified in the system.properties file as follows:

      javax.net.ssl.trustStore=$(deploy.home)/certs/simpleStore.jks
      Where <simpleStore.jks> is the Java Key Store and the <deploy.home> is the keyword to access the key store at the test run time.
    • Optionally, the properties sub directory that contains properties files such as system.properties, jmeter.properties, reportGenerator.properties, or user.properties.
    • Optionally, the lib sub directory that contains the lib and lib/ext content to be used at test run time. For example, the amq client and the plugins required to parse the jmx that contains amqp calls.
    • Optionally, the deps sub directory that contains the test dependencies.
    The resulting project directory can be as follows:
    myproject (that contains the jmeterRoot.jprj)
    myproject/mytests
    myproject/certs
    myproject/properties
    myproject/lib
    myproject/deps
  • You must ensure that you use a relative path when JMeter tests refer to other test assets. For example, if the JMeter test that is in the myproject/mytests folder refers to a mycsv.csv file that is in the myproject/deps folder, then the mycsv.csv is referred as follows: ../deps/mycsv.csv in the JMeter test.
  • You can create the JMeter project file named as jmeterRoot.jprj.

    The project file is a java properties file. The JMeter project file is required so that HCL OneTest Server can identify the asset as a JMeter project. You can specify additional information in the project file. You can specify the names of the sub directories created and through keywords you can specify the path in the properties files whether they are relative to the root directory or to the tests sub directory.

    For example, if you have created the following sub directories in the project directory called myproject that contains the jmeterRoot.jprj project file:
    • myproject/mytests
    • myproject/properties
    If the JMeter tests are contained in the following path: myproject/mytests/testplan/test1.jmx, and some dependencies that are also required to be deployed at test run time exists in the following path: myproject/mytests/testplan/localdir. You must specify these file paths in the project file as follows:
    testDir.localtest.sub.dir=localdir
    aSecondRootDir.sub.dir=dir2
    athirdRootDir.sub.dir=dir3
Restriction: You cannot run the test assets on a remote Docker host.