DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • CI/CD Integration: Running Playwright on GitHub Actions: The Definitive Automation Blueprint
  • Hybrid Vector Graph with AI Agents for Software Test Case Creation
  • Web App Load Testing Using Maven Plugins for Apache JMeter, and Analyzing the Results
  • When Memory Overflows: Too Many ApplicationContexts in Spring Integration Tests

Trending

  • Zone-Free Angular: Unlocking High-Performance Change Detection With Signals and Modern Reactivity
  • Improving DAG Failure Detection in Airflow Using AI Techniques
  • The Third Culture: Blending Teams With Different Management Models
  • LLM Integration in Enterprise Applications: A Practical Guide
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Steps To Integrate Selenium Test Case With Apache JMeter

Steps To Integrate Selenium Test Case With Apache JMeter

In this article, learn how to integrate selenium test scrips with JMeter for performance testing.

By 
Saranya Shanmugam user avatar
Saranya Shanmugam
·
Jul. 20, 21 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
6.1K Views

Join the DZone community and get the full member experience.

Join For Free

Integrating selenium test cases with JMeter can be done using the following concepts.

  1. Using JUnit Sampler
  2. Using WebDriver Sampler

Pre-Requisites:

  1. Required jars/plugins before we integrate selenium test scripts with Apache JMeter. 
  2. Download the Plugin Manager  Jar File from the website here.
  3. Put the File in the lib/ext directory in JMeter
  4. Then Restart JMeter

1. Using JUnit Sampler

Below are the steps along with a screenshot to perform pre-requisites for JUnit Sampler.

Step 1: Click “Options” and then “Plugins Manager" from Apache JMeter

Apache JMeter

Step 2: Download jpgc-webdriver 2.3 from the website here.

jmeter plugins

Step 3: Copy the lib/ext file and put the file in the lib/ext directory in JMeter folder

Step 4: Restart JMeter.

Refer Below Steps To Perform or Create JUnit Sampler Request

Step 1: Go to Thread Group --->  click on Add ---> click on Sampler --->select  JUnit Request as below shown in the screenshot:

Apache JMeter

The JUnit Request can be viewed as displayed below:

apache JMeter view request

Step 2: Considered we have already a JUnit test case created in Eclipse, to Export JUnit Test case ---> Right Click the JUnit Test case (Created in Eclipse IDE ) ---> Click on the “Export” option as shown below:

Selenium export

Step 3: Select “Jar File” under JAVA folder in Eclipse ---> Click “Next”

Select Jar File

Step 4: Now, Select the JUnit Test case ---> Give the path with (.jar) extension ---> Click “Finish”

Jar file specifications

Step 5: Now, Open Apache JMeter and click on Run  ---> JUnit Request.

To view the results ---> Go to “Thread Group”  ---> Add ---> Listener  ---> View Results Tree

View Results tree

The description of the Result can be viewed in “Sampler result” as displayed:

View result trees

2. Using WebDriver Sampler

Below are the steps to integrate the web driver sampler with Apache JMeter.

Step 1: Right Click Thread Group ---> Add ---> Sampler ---> jp@gc - WebDriver Sampler

WebDriver sampler

The “jp@gc - WebDriver Sampler” can be viewed as displayed

webdriver sampler

Step 2: Type the code given in the Screenshot below 

jp@gc webdriver sampler

Step 3: Save and Run the Test case ---> View The Results in View Results Tree

result tree

This is how we integrate either JUnit Sampler or WebDriver Sampler with Apache JMeter to do performance testing.

Test case Apache JMeter Testing Integration JUnit

Opinions expressed by DZone contributors are their own.

Related

  • CI/CD Integration: Running Playwright on GitHub Actions: The Definitive Automation Blueprint
  • Hybrid Vector Graph with AI Agents for Software Test Case Creation
  • Web App Load Testing Using Maven Plugins for Apache JMeter, and Analyzing the Results
  • When Memory Overflows: Too Many ApplicationContexts in Spring Integration Tests

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook