0

Detailed steps please, tried to use both HTMLUnit Driver Config and PhantomJs config, but no luck

How to run headless browser in jmeter for WebDriver Samplers, detailed steps please, tried to use both HTMLUnit Driver Config and PhantomJs config, but no luck. My requirement is I need to convert selenium script into jmeter script, I have created Webdriver script in jmeter, I need to run it with 100 users, as I donot want to launch 100 instances of browser, I want to run it as headless browser, directly creating jmeter load script is not an option as request is using a dynamic valuse which is not available in server response.

Buzzy
  • 2,905
  • 3
  • 22
  • 31

1 Answers1

0

You will launch 100 instances of browser in any case, no matter whether browser is headless or not and most probably your JMeter system will not be able to handle that many browser instances and you will have to go for distributed testing

Your "no luck" statement doesn't make sense as information is not sufficient to come up with solution.

  1. For HTMLUnit it is enough to add HtmlUnit Driver Config and WebDriver Sampler itself
  2. For PhantomJS Driver Config you need to download PhantomJS binary and specify location under PhantomJS -> Path to PhantomJS executable input. Of course add WebDriver Sampler with your code

    JMeter PhantomJS

  3. In both cases you will need to have Selenium client libraries somewhere in JMeter Classpath so make sure to install WebDriver Sampler using JMeter Plugins Manager - it will automatically take care of the dependencies.

    JMeter Plugins Manager WebDriver

If JMeter doesn't work as expected first of all check jmeter.log file for any suspicious entries - in 99% of cases it contains enough information to get to the bottom of the issue.


Also be aware that dynamic value is not a showstopper, in the absolute majority of cases it is somewhere in response (either in body, or in URL or in cookies, or in headers), in remaining cases it can be calculated or generated.

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