1

I want to launch chrome driver with a different proxy for each thread. My set up is:

  1. Thread Group - Minimum 5 number of threads
  2. JSR223 Sampler - Setting up proxy
  3. Chrome driver config - port is hard coded(8889)
  4. Transaction Controllers with Samplers

In JSR223 sampler, I am getting the free port using socket.getLocalPort(). I want to pass that value to Chrome driver.

Please help me to achieve this.

Bala
  • 184
  • 3
  • 19

1 Answers1

1

You will not be able to use Chrome Driver Config this way as it is an instance of Configuration Element, and Configuration Elements are executed before anything else, to wit on Thread Group iteration start.

So your Chrome Driver Config will be always executed before your JSR223 Sampler. If you still want to perform load test using real browsers you will not be able to use WebDriver Sampler having separate proxy server for each thread. The options are in:

  • Use single proxy and create it outside your Thread Group (i.e. in setUp Thread Group)
  • Do not use WebDriver Sampler and create your own WebDriver instances from scratch using JSR223 Sampler or JUnit Request Sampler
  • Use WebDriver Sampler in a single thread. As per WebDriver Sampler Tutorial:

    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.

    so you should not be using WebDriver Sampler for creating the main load, it is designed rather for measuring client-side performance while the system is under load coming from HTTP Request samplers. See How to make JMeter behave more like a real browser article to learn more about fine tuning JMeter test to be 100% realistic.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133