Install the JMeter Plugins Manager?
- Download the Plugins Manager JAR file
- Put the file in the lib/ext directory
- Restart JMeter
- Click “Options” and then “Plugins Manager”
The "Available Plugins" tab shows which plugins can be installed. To install, check the box next to the plugin name.
How to Integrate Selenium with JMeter:
- Open JMeter
- Click “Options” and then “Plugins Manager”
- Click on Available Plugins and search for "Selenium/WebDriver Support"
- Toggle "Selenium/WebDriver Support" checkbox and Click on Apply Changes and Restart button
- Create a Test Plan
- Right click on Test Plan - Add -Threads(Users)-Thread Group
- Right click on Thread Group and Add Config Element - jp@gc - Chrome Driver Config
- Download chromedriver.exe and provide the location in Chrome Driver Config e.g. - D:\Desktop\drivers\chromedriver\chromedriver.exe
- Right click on Thread Group and Add
Sampler - jp@gc - Web Driver Sampler
Listener - View Results Tree - Add scripts in Web Driver Sampler
- Save Test plan
- Click on Run button
- Validate Test results by clicking on View Results Tree
WDS.sampleResult.sampleStart() WDS.browser.get('https://google.com') WDS.sampleResult.sampleEnd() WDS.sampleResult.sampleStart() WDS.browser.get("https://www.google.com/"); var searchBox = WDS.browser.findElement(org.openqa.selenium.By.name("q")); searchBox.click(); searchBox.sendKeys('Test'); searchBox.sendKeys(org.openqa.selenium.Keys.ENTER); WDS.sampleResult.sampleEnd()
Note:
- WebDriver Sampler automates the execution and collection of Performance metrics on the Browser (client-side)
- While using WebDriver sampler each thread will have a single browser instance and each browser consumes significant amount of resources.
0 Comments