Selenium WebDriver Java Framework Course Limited Time Offer for $50

Selenium WebDriver Java Framework Course Limited Time Offer for $50


Testing SOAP REST Web Service With JMeter

We can easily run performance tests against Soap/Rest web services by using JMeter.  REST web services uses the HTTP request method with most popular protocols like : GET and POST. 

The responses return status codes indicating success or failure, along with any applicable headers, and JSON representing the affected fields (or nothing) in the message-body. In this example below, we use OpenWeatherApi  for web service test. For detailed information for the api, please visit the site:

Api to test (lookup the weather forecast by City name) 

Examples of forecast data for every 3 hours:
You can get weather forecast for 5 days with data for every 3 hours. All weather data can be obtained in JSON or XML format.

Call by city name at XML format,us&mode=xml
Call by geographic coordinats at JSON format
Call by city ID

Use Selenium WebDriver JUnit with JMeter

This example explains the basic design, functionality and usage of new JUnit Sampler for JMeter. We can use Selenium WebDriver with JUnit 4 tests in JMeter to do performance or stress tests.

For technical reference, visit the manual on Apache site

Test Case: do a performance test for Mahara ePortfolio Application Login Module. Test steps are as follows:

  • navigate to the site
  • enter "student1" in the user name field
  • enter "Testing1" in the password field
  • click on login button
  • Assert that "Dashboard" is displayed.


Step 1: create a Java project as shown on the picture below. project name is "JMeterJUnitProject", add a package named "com.seleniummaster.jmeterjunit" and add a JUnit test class "LoginTest". In the build path, add JUnit and Selenium Jar libraries.

Use Selenium WebDriver with JMeter

The Apache JMeter™ desktop application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

In this example, you learn how to use Selenium WebDriver with JMeter to test performance of a web application. This example uses Mahara ePortfolio system as an example. We test the application's login and logout performance. 

To use Selenium Webdriver with JMeter, simply install "WebDriver Set" plugins. The WebDriver sampler is very useful if you want to test for performance AJAX, GWT based web applications and simulated user actions. 

Step 1: download Apache JMeter

To download Apache JMeter, visit the site . click on the file " file" and download it. Unzip the file. 


Selenium TestNG Load Testing

When using Selenium for performance or load testings, in addition to using Selenium Grid for parallel execution, we can use Selenium + TestNG for load testing.

In this example, you will learn how to use @Test attributes invocationCount and threadPoolSize to perform a load test or stress test on a site.

Note: in this example below, Mahara ePortfolio application is used as a test application. 

@Test(invocationCount=?) determine how many times TestNG should run this test method.

This example is using Selenium Master Test Application Login Test as a test for load testing.

Step 1: create a Java Project as shown on the picture below. Add TestNG and Selenium library to the project.