0
votes

I have a jmeter project where I am trying to performance test a UI and I am using webdriver sampler for the same (My first project with webdriver sampler)

To generate proper load on the server, I am using http sampler thread group where I usually provide high number of users (for load generation) and use 1 thread for the webdriver sampler to measure user rendering metrics. The execution is in such a way that the threads are executed at every 10 seconds. I have tried to use the "Synchronizing timer" in jmeter to ensure that the thread groups gets executed at the same time.

I am facing the issue as the http sampler and webdriver sampler threads do not start at the same time. There is a difference of 1-5 secs. I also see in my server logs that the hit from the UI came at a different time.

Here is the Thread start time from jmeter ('Start Time' column in 'View Results in Table' listener)

http Sampler thread: 00:02:47.846
Webdriver sampler thread: 00:02:51.902

Here are the logs from server logs:

Windows Server 2016 2020-12-26T00:02:51,245 ################## this may be call from http sampler
Windows Server 2016 2020-12-26T00:02:52,399 ################## this may be call from webdriver sampler

As we can see, although the threads got initiated at different times in jmeter, but due to the synchronizing timer, the calls must have been made at about the same time. But, there is still a mismatch of ~1 sec (as observed in server logs).

Due to this mismatch, the rendering time is not getting calculated accurately as the server is not under load when the webdriver sampler call comes in. I tried to use the synchronizing time, thread startup delays but they are not solving the issue. I am not sure if this is due to any extra overhead that the webdriver sampler may have.

Is this a common use case while using webdriver sampler and is there a way to fix this and have both the threads hit the server at the same time?

Extra setup Info: The jmeter and AUT are on the same server.

1

1 Answers

1
votes

Synchronizing Timer controls start time of the sampler(s) in its scope, you cannot control when the request will "hit" the server due to:

  1. Connect time
  2. Selenium overhead (it sends commands to the browser over the network as well), moreover it takes some time for the browser to "react" to the command so WebDriver Sampler will always be slower and the factor is not deterministic

I also have some doubts regarding your test design, the requests are not supposed to be made at exactly the same moment, you need to ensure that JMeter's HTTP Request samplers are configured to behave just like a real browsers and that the load is continuous, i.e. you simulate X users concurrently accessing your application for i.e. 30 minutes and during this test in another Thread Group you can have a single WebDriver Sampler which will be checking rendering time when the system is under the load