- Start Apache JMeter (see here how to run Apache JMeter on Mac systems)
- Make use of the JMeter Plugins (check here how to use the Apache JMeter plugins)
- Add a new Stepping Thread Group
- Add a Chrome Driver Config
- download Chrome Driver for Mac from here – https://sites.google.com/a/chromium.org/chromedriver/
- set the Path to Chrome Driver (i.e. /Users/user/Downloads/chromedriver)
- 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}
WDS.sampleResult.sampleStart()
WDS.browser.get('https://www.example.com?uid=${token}')
WDS.sampleResult.sampleEnd()
- 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.
Is Your Infrastructure Ready for Global Traffic Spikes?
Unexpected load surges can disrupt your services. With LoadFocus’s cutting-edge Load Testing solutions, simulate real-world traffic from multiple global locations in a single test. Our advanced engine dynamically upscales and downscales virtual users in real time, delivering comprehensive reports that empower you to identify and resolve performance bottlenecks before they affect your users.