Print

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: http://openweathermap.org/api

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 api.openweathermap.org/data/2.5/forecast?q=London,us&mode=xml
Call by geographic coordinats at JSON format api.openweathermap.org/data/2.5/forecast?lat=35&lon=139
Call by city ID api.openweathermap.org/data/2.5/forecast?id=524901
Print

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 http://demo.mahara.org
  • enter "student1" in the user name field
  • enter "Testing1" in the password field
  • click on login button
  • Assert that "Dashboard" is displayed.

Implementation

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.

Print

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 http://jmeter.apache.org/download_jmeter.cgi . click on the file "apache-jmeter-2.11.zip file" and download it. Unzip the file. 

 

Print

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.