You have your Jmeter installed and now you wish to use web server sampler,then let us start from basics and see the challenges you might face before you successfully execute your first script.
Download the latest version of JMeterPlugins-WebDriver from "http://jmeter-plugins.org/downloads/all/#".
Note:Notice the version of above jar as this will be important for browser compatibility
Ref: (http://jmeter-plugins.org/wiki/FirefoxDriverConfig/)
For example,we are trying to execute a simple script that has been described in "http://jmeter-plugins.org/wiki/WebDriverTutorial/" :(2 Minute Guide).Here is the complete test plan.
Note:I have just copied everything from the site and then provided issues that i have faced
Download the latest version of JMeterPlugins-WebDriver from "http://jmeter-plugins.org/downloads/all/#".
Note:Notice the version of above jar as this will be important for browser compatibility
Ref: (http://jmeter-plugins.org/wiki/FirefoxDriverConfig/)
For example,we are trying to execute a simple script that has been described in "http://jmeter-plugins.org/wiki/WebDriverTutorial/" :(2 Minute Guide).Here is the complete test plan.
Note:I have just copied everything from the site and then provided issues that i have faced
Test plan having a Thread Group containing 1 thread. The next steps will cover adding the following elements to your test plan:
- Firefox Driver Config
- Web Driver Sampler
- View Results Table
Your basic Test Plan should look like this after adding the Thread Group:
Firefox Driver Config
Add a Firefox Driver Config to your Thread Group.
Web Driver Sampler
Add a Web Driver Sampler to your Thread Group.
Add the following Javascript code to the Script section to navigate to Google.
View Results Table
Add a View Results in Table to your Thread Group and then run your test. You should see something like the screenshot below that captures the result of the sample.
Now Execute the script and you might see a error like below in your log file.
Issue 1: Above issue arises due to duplicate jar files in jmeter "lib" folder.Browse your jmeter installation folder and open the "lib" folder.Now check for duplicate jar files and remove the older version of all duplicate jar files and keep the latest version of jar files.You will mainly find below files having duplicate copy.
- commons-jexl-
- httpclient-
- httpcore-
- httpmime-
Remove above duplicate files and and you will be free from your above issue.Congrats......
Issue 2:You might face another issue "Test failed!java.lang.NoClassDefFoundError:org/openqa/selenium/os/Kernel32" as shown in below screen shot.
Above issue arises because of non-availablity of two jar files(jna and jna-platform) in your jmeter "lib" folder.
- jna-3.3.0
- jna-3.3.0-Platform
Note: jna file version might be different in your case
Download above two jar files and place them in your "lib" folder and restart your jmeter.Above issue is hopefully resolved now.
Issue 3:
You might see issue indicating failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055;
This issue arises non-compatibility of browser with web server sampler version.Download the proper version of Firefox as per instruction provided in "http://jmeter-plugins.org/wiki/FirefoxDriverConfig/" and execute your script after restarting the Jmeter.