In order to leverage functional Selenium tests and produce load test scripts, you can convert existing Selenium scripts into JMX (Java Management Extensions) files. This avoids the need to update and maintain JMeter scripts every time the web application changes. The scripts can be easily converted from an existing Selenium script. You need to maintain functional Selenium tests throughout application development. A well maintained and updated functional test is required to execute load tests.

There are various tools that can help to automate this process completely. Taurus is an open source automation tool that can help in building a series of functional Selenium tests. Taurus converts the “passed” Selenium tests into load tests and uses the JMeter to run the load tests.

  1. To convert, use the most updated version of Taurus (1.6.6 or above). Install Proxy2JMX Converter Taurus Module.image001
  1. Put the Selenium scripts in the Taurus Examples directory.image003
  2. This can be seen under the Selenium examples directory.image005
  3. The configuration would look like:image007
  4. According to the configuration, Selenium will perform 1 iteration using the scenario from the “dir” directory. The converter will use a proxy recorder to generate “Smart JMX”.
  5. When you will run the test, Taurus will launch and execute the Selenium test. This will use the proxy to convert the traffic into JMX.
  6. Once the job is over, use JMeter to open the resulting JMX.
  7. You will see the structure of the requests.image009
  8. Launch the test in the ‘View Results Tree’ and see the converted scripts.image011