Objective:
Because some projects use WEBGL technology, high-version Firefox and Chrome browsers are required to support browsing, and compatibility is weak, resulting in LoadRunner and JMeter (Badboy) not recording scripts properly. So we use the Selenium IDE to record scenes and convert to JUNIT4, export the jar file after Eclipse compilation, and test with the JUnit request control in JMeter
Pre-conditions:
JAVA Environment:
C:\users\user>java-version
Java Version "1.8.0_102"
Java (TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.102-b14, Mixed mode)
Eclipse version:
Eclipse Java EE IDE for WEB developers.
Version:mars.2 Release (4.5.2)
Selenium version:
Selenium-java-3.0.0-beta2
Jmeter version:
Browser Environment:
Firefox version 49.0.2 (Firefox version will crash temporarily abandoned)
Google Chrome version 54.0.2840.71 m
Driver version:
Google Chrome Driver 2.2.5:http://docs.seleniumhq.org/download/
Environment deployment:
ü1.8 version JDK installation and environment parameter configuration, this oneself Baidu a bit
Üeclipse can go to the official website to download, the version of the higher also no problem
U Selenium chose the version after 3.0, because of Firefox and other browser upgrades, the previous version is not compatible (should be the reason for Firefox to use the kernel upgrade, do not assume that the reference, interested friends can study it), I verify 3.0 temporarily 49 version of Firefox no problem, I downloaded the Seleni Um-java-3.0.0-beta2.zip, you can find it online, unzip it into a direct class package or Eclipse corresponding class package
Üjmeter Download the latest version, I use the 3.0 version, now seems to be the latest version is 3.1, unzip the downloaded JMeter folder under the D packing directory, click ... \bin\jmeter.bat, start jmeter
ü Install Firefox or Google Chrome
ü Place the downloaded Chromedriver.exe and Geckodriver.exe in the D:\MyDriver folder and add the path to the system variable path
Script recording
- To start Firefox, click "Add-ons" in the menu list on the right, as shown in:
- Search for "Selenium ide" in "extensions" and install the Selenium IDE components that you have searched for, as shown in:
Note: Since I have installed the Selenium IDE all in my add-ons
- Restart the browser after successful installation, click "Developer" in the "menu" on the right, you can see the installed Selenium IDE components as shown in:
- Click on the "Selenium IDE" pop-up window as shown in:
- At this point the red button is pressed, that is, in the recording state, in the browser to make a booking page operation, Selenium IDE will record the relevant execution script (specific Selenium IDE tutorial can Baidu, not described in detail here), after the completion of execution click the red button to stop recording, as shown:
- Click the "Play back" button to test whether the recorded script is performing properly, and to determine that the script does not have a problem after exporting the script, as shown in:
Webdriver-based JMeter performance testing-selenium IDE