How to Convert Existing Selenium Scripts into JMX files?
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.
- To convert, use the most updated version of Taurus (1.6.6 or above). Install Proxy2JMX Converter Taurus Module.
- Put the Selenium scripts in the Taurus Examples directory.
- This can be seen under the Selenium examples directory.
- The configuration would look like:
- 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”.
- 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.
- Once the job is over, use JMeter to open the resulting JMX.
- You will see the structure of the requests.
- Launch the test in the ‘View Results Tree’ and see the converted scripts.