DEV Community

Raghwendra Sonu
Raghwendra Sonu

Posted on

5 2

JMeter integration with Selenium using WebDriver sampler

Step 1:
Add plugin Selenium/WebDriver Support in JMeter.

Alt Text

Step 2: Create a test plan - add thread group
Add Config Element - jp@gc - Chrome Driver Config Sampler - jp@gc - Web Driver Sampler and Listener - View Results Tree.

Alt Text

Step 3: Download chromedriver.exe and provide the location in Chrome Driver Config as in above screenshot.e.g. -D:\Desktop\drivers\chromedriver.exe

Step 4 : Add scripts in Web Driver Sampler
e.g:
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()

Alt Text

Step 5 : Run & Validate

Alt Text

Notes:

  1. WebDriver Sampler automates the execution and collection of Performance metrics on the Browser (client-side).
  2. While using WebDriver sampler each thread will have a single browser instance and each browser consumes significant amount of resources.

Billboard image

Use Playwright to test. Use Playwright to monitor.

Join Vercel, CrowdStrike, and thousands of other teams that run end-to-end monitors on Checkly's programmable monitoring platform.

Get started now!

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay