We released a Firefox Plugin, which integrates Selenium and JMeter. The goal of this plugin is to replay your Selenium test case or suite and capture the interaction as a JMeter (.jmx) performance test plan. Here is a tutorial for using this plugin.
- Install JMeter-Selenium Firefox Plugin
- Build your test plan
- Configure recorder for proper includes
- Turn on the recorder
- Run your test plan
- Turn off recorder and save results
- Load JMX into JMeter and test
- Load JMX into RedLine13 and Run at scale
Prefer a video walkthrough? Send me an email (firstname.lastname@example.org) based on demand will put one together.
Step 1. Install
From Firefox go to https://addons.mozilla.org/en-US/firefox/addon/jmeter/ and install the plugin.
Requirement – you must have Selenium-IDE installed
Step 2. Build your test plan
Let’s use a cross-platform Ionic app I recently wrote (RunSignUp Results) as our test case.
- Test Plan includes
- Navigate to home
- Change search date
- Find and Navigate to a Race
- Select a user in the race to review results
- The results app is written with angular (ionic+cordova+angular) so we had to modify the recorded test case.
- Don’t forget to save your Selenium Test Plan
Step 3. Configure the Recorder
We don’t want to capture every request, so let’s limit to items from the domain we are working with – results.runsignup.com
- In the sidebar or dialog go to Options and press ‘JMeter Options.’
- A preferences web page for the plugin will open
- Modify the ‘Includes’ setting
We have many options but right now let’s just change the includes to allow the domain we are testing.
Step 4. Turn on the recorder.
The plugin will just sit in the background listening for requests, only capturing information for the HTTP(s) requests we want to track.
- Press the ‘RedLine13 Button.’
Step 5. Run the test case
Let’s play that Selenium test case.
- Press the ‘Play Current Test Case.’
Step 6. Stop Recording and Save Output
Once we finish recording, we will immediately have a chance to output or newly created JMX test case.
- Press ‘RedLine13 Button.’
Step 7. View test case in JMeter
We open the test plan in JMeter so we can validate it captured as expected and modify as desired.
At this point feel free to navigate the generated test.
The test plan was created to run one user with one iteration, so let’s run and see the output.
Success! From Selenium to JMeter.
Step 8. To Scale the test Open Test Case in RedLine13
Before we open in RedLine13 and still in JMeter tweak the load test to run as 25 users (threads).
Now let’s get it running on RedLine13
- Import JMX
- Select running as two servers, which will simulate 50 users (2 * 25 threads)
Press ‘Start Test’ and wait for results!
Want to take a look at the JMX or the Test?
- Questions: https://groups.google.com/forum/#!forum/redline13
- Start a Test (Almost Free) : https://www.redline13.com/Service
- Paid Subscriptions include help for this plugin
- Plugin: https://addons.mozilla.org/en-US/firefox/addon/jmeter/
- Plugin Source: https://github.com/redline13/selenium-jmeter