Author - StudySection Post Views - 1,022 views
selenium certification

Load Testing using Selenium with Jmeter

Load Testing: Load testing is a software testing technique to test the behaviour of the website/application under different load conditions. It is a type of performance testing which determines software performance by simulating under real-life loads conditions. This type of testing is typically performed when a software development project is near to complete. Load testing is intended to test the website/application by constantly and steadily increasing the load on the application until it reaches the threshold limit.

Requirements for Load testing:

  1. Java
  2. Eclipse: To create a selenium project.
  3. Selenium jar(, Chrome Browser jar(, and JUnit jar( file.
  4. Jmeter: To perform load testing of the selenium script.

Steps to Perform Load Testing using Selenium with Jmeter:

  1. Create a new project using the selenium in the “Eclipse”.
  2. Add required jar files in the project.
  3. Create a new class and write a script using the JUnit annotation.


    package LoadTesting;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import org.openqa.selenium.WebDriver;
    public class LoadTest 
       static WebDriver driver;
       public void before()
    			driver = new ChromeDriver();
    			System.out.println("Open the browser");
       public void test()
    	  		System.out.println("Navigate to the URL");
       public void after()
    			System.out.println("Close the browser");

    In this example, we are navigated to the website (

4. Export script class into the JAR file and save jar file into the system:

5. Move the script jar file into the JMeter library folder location:

6. Add JUnit and Selenium extracted jar file with Jmeter library folder.

7. Now launch JMeter and create a Thread Group for performing load testing.
a. Add a new “Test Plan”.

b.Create a new “Thread Group(Thread Groups is a collection of Threads. Each thread represents one user using the application )”.
Add >> Threads >> Thread Group.

c. Add JUnit Request from “Sampler”.
Add >> Sampler >> JUnit Request.

d. Click on the “Search for JUnit 4 annotation” then check the “ClassName and Test Method”. It will fetch your created jar file and displayed in the ClassName.

e. Add any listener to check the result in the Group.
Add >> Listener >> View Result Tree.

Now Run the script and check the result:

I am running my script with Number of Threads(User): 5
And Ramp up period(in seconds):30

We can check the result two times script is failed out of 5 times.

Leave a Reply

Your email address will not be published. Required fields are marked * cratosroyalbet betwoon grandpashabet grandpashabet giriş deneme bonusu veren siteler casino siteleri