Apache JMeter Load Testing Performance Testing Selenium WebDriver UI Testing

3 minutes read
Here is how to use Apache JMeter’s WebDriver Sampler to load test the UI of the application, and by the UI, I mean load test a user’s workflow, with entering the web pages, clicking on different links etc.
All you have to do is install the JMeter plugins and make use of the WebDriver Config and WebDriver Sampler plugins which will offer this capability.
Let’s go into more detail and see how to load test an app with Apache JMeter’s WebDriver Sampler.
Here are the steps to Load Test the UI:

  • Add a Chrome Driver Config

      • choose if you want to create a new Browser at the start of each iteration (if you don’t tick this option, the browser instances are going to be reused per each thread, which will cache some of the assets, requests)

  • Add a WebDriver Sampler

      • add the following code which will monitor the load time for loading the following webpage https://www.example.com?uid=${token}

      • the token variable is previously generate by an HTTP POST request
      • imagine the scenario where you first have to authenticate in order to access a webpage, this is what we do
          • generate a token with an HTTP POST request
          • extract the token from the HTTP POST response

        • open the webpage with the token as a query parameter and monitor the load time
    • add an Aggregate Report in order to measure the load testing metrics like number of samples, response times, errors, throughput

    • add the Listeners from the JMeter Plugins: Response Times Over Time, Hits per Second and Active Threads Over Time to better understand the behaviour of your application while running the load test of the UI

Run the test at the beginning with only 1 thread in parallel, to create the baseline. The you can increase the number of threads (parallel users) to find performance bottlenecks. Here are more details on performance testing vs load testing.

Hope this helps.

Apache JMeter Test Automation

2 minutes read

Here are details on how to save or export the results of your Apache JMeter test script to a CSV or XML file.


1. Open Apache JMeter (here is how to start Apache JMeter on Mac) and right click Test Plan and Add -> Threads (Users) -> Thread Group
2. Right click Thread Group and Add -> Samplers -> HTTP Request
3. Add example.com to the Server input field of the HTTP Request
4. Right click Thread Group and Add -> Listeners -> Aggregate Report

More details on how to load test a web server with Apache JMeter.

Save Apache JMeter Results to a CSV file

1. Configure the filename in the Filename field of the Aggregate Report
i.e.: [FULLPATH]/results.csv
where [FULLPATH] is the path on the disk to the directory where you want to save the Apache JMeter results.
2. Run the test script
A file with the results.csv name should now be created at the path specified.

Save Apache JMeter Results to a XML file

1. Go in the Aggregate Report and click the Configure button
2. Check the Save as XML field in the top left corner.
3. Change the extension of the filename to XML i.e. [FULLPATH]/results.xml

A file with the results.xml name should now be created at the path specified.


Save results to current test script location

If you want to use the current test script location as the destination of your Apache JMeter test scripts, you can follow the below steps:

See more details

Apache JMeter note:
Don’t use GUI mode for load testing, only for Test creation and Test debugging!
For load testing, use NON GUI Mode & adapt Java Heap to your test requirements

Test Automation

2 minutes read

We’ve speed tested over 30000 websites and here are the speed test results after running the website speed tests:

Total: 30000 websites tested – Check how fast is your website for free

Response times between 0ms – 200ms
223 (<1%) websites with response time between 0ms – 200ms

Response times between 200ms – 500ms
641 (~2%) websites with response time between 200ms – 500ms


Response times between 500ms – 750ms
708 (~2%) websites with response time between 500ms – 750ms


Response times between 750ms – 1000ms
718 (~2%) websites with response time between 750ms – 1000ms


Response times between 1000ms – 2000ms
3794 (~16%) websites with response time between 1000ms – 2000ms


Response times between 2000ms – 3000ms
3521 (~11%) websites with response time between 2000ms – 3000ms


Response times between 3000ms – 5000ms
4961 (~16%) websites with response time between 3000ms – 5000ms


Response times between 5000ms – 10000ms
5641 (~19%) websites with response time between 5000ms – 10000ms


Response times between: greater than 10000ms
9793 (~32%) websites with response time between 10000ms



Only 7% of the websites tested have a response time lower than 1 second.

Also more than 50% of the websites tested, almost 15k websites, have a response time greater than 5 seconds.

A higher response time translates indirectly in potential customers leaving your website.
How to Improve Your Page Load Speed by 50% in less than 30 Minutes? Here are a few hints which can make a huge difference:
  • minify assets (JS files, CSS files)
  • minify HTML
  • use CSS Image Sprites
  • optimise images
  • use CDN for hosting images and other assets (fonts etc) – inspect latency
  • move JS files at the bottom of your HTML page and CSS files at the top
  • group multiple CSS files and JS files into a single (minified) CSS or JS file if possible
  • eliminate Render-Blocking JavaScript and CSS (Async Javascript)
  • rely on browser caching
  • remove unused widgets, plugins
  • improve server side hardware (DB queries, hardware, etc)
  • more details on increasing rendering speed
As you saw above, there are loads of things you can do to improve your website rendering speed. We also offer a free website speed test.
To get a better understanding and speed insights related to your website, create an account today with LoadFocus and run a full website speed test.

Selenium WebDriver Test Automation UI Testing

2 minutes read

If you want to open a new tab in the browser with Selenium WebDriver and Java, below we’ve listed some working examples. Have in mind that at the moment, Selenium WebDriver has no build-in ability to open new tabs or new windows, and because of this we have to force the browser to open the links in new tabs or in new windows. This may be implemented in a later version of Selenium WebDriver.

1. Open an existent link a a new tab using Selenium WebDriver and Actions

More details on how to locate web elements with Selenium WebDriver.

//identify the link in the page, that you want to open in a new tab of your browser's instance
WebElement link = driver.findElement(By.cssSelector(linkLocator));

//this action will click the WebElement with the link identified above, hold CONTROL Key (or COMMAND if you're using Mac), click the WebElement and relese the Keys.CONTROL (use Keys.COMMAND if you're using Mac).
new Actions(driver)

The code above works in all browsers.

2. Open an existent link a a new tab using Selenium WebDriver with CONTROL/COMMAND Key and T

There is also another option that may not work in Chrome browsers at the moment because of a limitation in the way keyboard inputs are simulated in ChromeDriver. Keys are sent directly to the render process, so any keyboard shortcut in the browser process will not be invoked by sendKeys() method.

See more details

How fast is your website comparing to your competitor’s? Check now!

Load Testing Performance Testing Test Automation

2 minutes read

If you ever asked yourself “What is the difference between Performance Testing and Load Testing”, below are listed some of the main characteristics of Performance Testing and Load Testing, and how are they different from one another.

What is Performance Testing?

Performance Testing represents the characteristics of a system, how fast is that system, in general it refers to the tests undertaken to determine how that system behaves and performs.

Prerequisites for Performance Testing

We need to have clearly defined goals before starting any performance tests. The goals defined will help us if after getting the performance tests results there is a need for system improvement.

Performance Testing Results

After running performance tests, you need to inspect the metrics like response and latency times, hits per second, throughput per second, errors (client side metrics) and CPU, Memory, I/O (server side metrics) for the system tested.

Performance Testing Goals

Set a base line for the system under test for future releases and potential improvement of the system. It helps to identify potential bottlenecks, that can be found at different levels: system level (client and server side), DB level, network level.

LoadFocus.com is a All-In-One Cloud Testing Platform for Load Testing and Performance Testing, Website Speed Testing, Automated Website Testing and Mobile Emulation for Websites, Mobile Applications and API Endpoints.

Test Automation

1 minute read

While testing different applications you will get to the need of testing the following scenario:

The user is opening the application, clicks the Overview button which sends the application
to background and reopens the application by choosing it from the recent used application.

To be able to do that you need to know how to implement two important actions:
1. Click the Overview button which send the application to background; for doing this you can use the following
code snippet written in Java:

public void clickOverviewButton(){

Hope this helps with your daily testing tasks. Details on how to use the Overview, Home and Back buttons in Appium for Android

Selenium WebDriver Test Automation UI Testing

2 minutes read

Here are details related to using waits with Selenium WebDriver in Java. According to the Selenium documentation, at the moment, there are two different type of waits: explicit and implicit.

After you understand how to locate elements with Selenium WebDriver, you have to focus on waiting for elements to appear, be visible, be clickable.

Waiting is an automated step, elapse a certain amount of time, before execution can continue. Choose to use Explicit Waits or Implicit Waits. As a side note, you should not mix implicit and explicit waits.

Implicit Waits in Selenium WebDriver

An implicit wait tells WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available.

The implicit wait is set for the life of the WebDriver object instance.

WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

//use a URL that delays loading elements
WebElement myDynamicElement = driver.findElement(By.id("myDynamicElement"));

You can set the implicit wait when you first instantiate the WebDriver:

See more details


LoadFocus.com is a cloud testing platform, use Automated Website Testing Service to build functional tests and automate regression manual tests of your website, more details.