These configurations are suited when you want to test desktop browsers on the same system as JMeter. If you want to execute the tests on a remote system (via a Selenium Grid for instance), then use the Remote Driver configuration.
For an overview of performing client side performance testing, refer to the Web Driver Tutorial.
At the time of writing, five types of browsers are supported by JMeter Web Driver plugin:
- Chrome (Chrome Driver Config);
- Edge (Edge Driver Config);
- Firefox (Firefox Driver Config);
- Internet Explorer (InternetExplorer Driver Config);
- HtmlUnit (HtmlUnit Driver Config), a GUI-Less browser;
HtmlUnit is a good compromise between speed of execution and the CPU usage per thread while maintaining Selenium API. The main drawback is that there is no screen so it's more difficult to understand the cause of problems and also that the javascript engine is not powerful as browsers such Firefox or Chrome.
The configuration of eacḣ browser follows the same principle and is divided across four different tabs:
- the Driver tab;
- the Options tab;
- the Proxy tab;
- the Capabilities Management tab;
First, you need to manually download the appropriate driver from the Quick Reference Section and then specify the location of the driver in the "Path to Driver" field.
For the IE driver, ensure you download a version >= 4.5.0 as IE drivers from this version and onwards will automatically look for Edge on your system and use it in IE Mode. Note that it is not required to download a driver for HtmlUnit.
Beware that most machines automatically update the browser, but not the driver which may cause your test to fail in case the driver becomes out-dated. So ensure you regularly check that the versions of the driver and its browser match.
The Driver tab also contains some common capabilities that are shared by all browsers. Their names are meaningful by themselves; but you can also refer to the w3c specification for further description of these options.
This tab contains some custom options for each browser. Their names are meaningful by themselves. At the time of writing, there are no options to configure for HtmlUnit.
In the Options tab of Chrome for instance, you can specify the location of a Chrome Binary in case you want to test a different version of Chrome from the standard one. Leave this field blank if you are happy to test the Chrome that is defined in your path variable.
You can find more information on the Chrome options presented in this tab at Capabilities & ChromeOptions.
In the Options tab of Edge, you can specify the path to a fixed Edge version to use in case you want to test a different version of the default one on your PC. Leave this field blank if you are happy to test the Edge that is defined in your path variable.
You can find more information on the Edge options presented in this tab at Capabilities & EdgeOptions
In the Options tab of Firefox, you can override the user agent of Firefox. To do so, check the 'Override User Agent' checkbox and then paste in the user agent string to use. The UserAgentString.com site has an extensive list of user agent strings.
There is also an option to enable NTLM.
You can find more information on the Firefox options presented in this tab at firefoxOptions.
In this tab, specify the url IE will load on start-up. By default, it will go to "https://wwww.bing.com".
You can find information on the other options presented in this tab at IE specific functionality
The default configuration (Use system proxy) is suitable for most. However, if you are in a corporate environment and a browser fails to connect to a URL, this is most likely because the environmemt needs a proxy to be accessed.
Use this option if you directly connect to the internet, and your network will not make use of any proxies.
Some networks will automatically transmit the proxy configuration. This is especially true for Microsoft Windows networks that make use of WPAD/PAC to transmit the proxy configuration to its host.
This is the default configuration, and will make use of the network and/or proxy settings configured for your Operating System.
This is the most involved, but also allows for the most control of you proxy settings.
Specify the name/IP Address of the HTTP proxy server and its associated port to use when the browser makes external network connections.
By default this is checked, as most environments use the same HTTP Proxy server for its SSL, FTP and SOCKS connections. However, if this is not the case, then uncheck this option, and override the settings for the other connections.
Specify the name/IP Address of the HTTPS proxy server and its associated port to use when the browser makes external network connections.
Specify the name/IP Address of the FTP proxy server and its associated port to use when the browser makes external network connections.
Specify the name/IP Address of the SOCKS proxy server and its associated port to use when the browser makes external network connections.
This is a comma separated list of all host(s) and/or IP Address(es) that will bypass the proxy server.
For networks that have a proxy configuration server (PAC), and its name and the location of the PAC file is known, please use this option. The usual configuration for this is http://proxy-server/proxy.pac
This tab enables custom webdriver capability configuration using Json as input. You need to specify the capabilities you want as a JSON string such as in "{"key1":"value1","key2":"value2"} where "keyx" is the capability name and "valuex" the value you want for this property. These capabilities are appended to both "capabilities" and/or "desiredCapabilities" as allowed by webdriver.
This is especially useful when using webdriver W3C extension capabilities, which allows for more advanced/custom webdriver requests. See https://www.w3.org/TR/webdriver1/#dfn-extension-capability.
You can read output logging from Developer Tool, just use the following code:
<syntaxhighlight lang="javascript"> var logPkg = JavaImporter(org.openqa.selenium.logging) WDS.sampleResult.sampleStart() WDS.browser.get('http://yoursite.com') var logEntries = new logPkg.LogEntries(WDS.browser.manage().logs().get(logPkg.LogType.BROWSER)); logEntries.forEach(function(entry) { WDS.log.info(entry.getTimestamp() + " " + entry.getLevel() + " " + entry.getMessage()); }) WDS.sampleResult.sampleEnd() </syntaxhighlight>