Web Performance has discontinued direct support for Selenium/WebDriver in Load Tester. One of the limitations of load testing with Selenium/Web Driver is that it takes lots and lots of cloud machines to generate load. Virtual users, on the other hand, are very efficient, cheaply simulating up to millions of users. This blog post shows one possible option, playing back your selenium scripts directly into the Load Tester recorder where they can be edited and played back with lots of virtual users.
Download Load Tester and install it on your Windows machine if you haven’t already. Double-click on the installer and follow the instructions.
Since Selenium IDE runs inside Firefox it will be need to be configured to record with Load Tester. Note that this process also works if you’ve written selenium scripts in a programming language, but in that case wherever the instructions say to start playback in the IDE you’ll have to do that within your programming environment.
You should already have Firefox installed if you’re using Selenium, but if not, download and install it now. Recording with Firefox from Load Tester will automatically install the special SSL certificate needed to enable recording.
To do this first click on the red Record Button, below.
Then select the Firefox icon:
The program will then ask you to install the SSL certificate:
Click on the stop recording button to stop the recording process for now so we can complete the configuration process.
For recording to work Firefox’s HTTP proxy must be configured to route HTTP traffic through Load Tester. Go to Firefox’s proxy settings and use the IP address 127.0.0.1, and the port
2525 for HTTP and 2526 for SSL. Menu->Options->Advanced->Network.
Load Tester normally randomly generates its own port values. For this to work you’ll need to turn off that feature. From within Load Tester go to Window->Preferences->Load Tester->Recording and make sure “Manually Select Recording Ports” is checked.
Start a recording in Load Tester again by clicking on the red record button:
This time, however, instead of selecting Firefox, click on Show More Options:
This will bring up the option to do system-wide HTTP recording. Select “No Browser – Capture Systemwide Traffic”, and click “OK”.
Once Load Tester recording has started you can then initiate playback either from Selenium IDE or by starting a programming language script containing Selenium/WebDriver code. To start Selenium IDE go to the Firefox menu and select Selenium IDE:
If you’re using Selenium IDE be sure to select the slowest playback speed so that Load Tester can group the HTTP requests into web pages by moving the speed slider all the way to the right to “Slow”:
When playback has started you should notice that web pages are starting to show up inside Load Tester:
When playback finishes click on Load Testers big “stop recording” button.
Load Tester uses the natural rhythm of real users to separate out HTTP requests into web pages, but Selenium IDE will try to play back the requests as fast as possible, even on slow mode, with no think time like a real user. This can sometimes cause the page groupings to be off. To fix this, expand the web pages one by one, and see if you can identify the start of a new web page. When you find one, right-click on it and select “Start new Web Page with URL”. This will create a new web page grouping with that URL and any subsequent URLs already in the current web page.
The recording should now have recognizable web pages more like from the Selenium script:
Now that the test case is in Load Tester there’s a wide variety of customizations available. The most common is to configure data replacement, so that each user has a separate user name and password, for example, or types in separate information into forms. There are a large number of tutorials available, or just type your question into the search bar and search the entire site.
Founder of Web Performance, Inc
B.S. Electrical & Computer Engineering
The Ohio State University
LinkedIn Profile