I have done automation script for web application by webdriver sampler using groovy for mesure client side performance.

can i use this script to generate load to server in headless mode and measure the client side performance of the application by another copy same script without checked headless?

1

There are 1 best solutions below

0
Dmitri T On

The difference is that:

  • Selenium-based scripts automate real user actions in the real browser
  • Recorded script simulates network footprint created by the browser when user opens pages, submits forms, etc.

Theoretically you can run your WebDriver Sampler scripts in a multithreaded manner, just add the desired number of threads (virtual users) in the Thread Group

enter image description here

and JMeter will kick off as many browser instances (no matter headless or GUI) as there are threads.

However be informed that using Selenium for performance testing is neither recommended by Selenium developers:

Performance testing using Selenium and WebDriver is generally not advised. Not because it is incapable, but because it is not optimised for the job and you are unlikely to get good results.

nor by WebDriver Sampler developers

Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.

The main reasons are in:

  • real browsers are very resources intensive, a browser instance will take 1 CPU core and 2 GB of RAM. With JMeter's HTTP Request samplers you can simulate hundreds of users using this hardware resources
  • you won't be able to correlate the increasing load with other test metrics like response time, connect time, latency, calculate number of hits per second, etc.

So I would rather recommend to conduct the main load using JMeter's HTTP Request samplers (just make sure that JMeter is configured to behave like a real browser)

Your existing Selenium tests can be used for measuring the frontend performance