How to set Chrome driver for selenium/Webdriver in Jmeter non-gui using Command prompt?



  • I am executing the load test plan using the non-GUI mode of Jmeter and I want to set the chrome driver using non-GUI mode. I have used the below command for executing the test plan and storing the results.

    jmeter -n -t D:\JmeterSeleniumScripts\LCOrderSummryReport.jmx -l D:\JmeterSeleniumScripts\lcOrderSummaryResults.jtl -f -e -o D:\JmeterSeleniumScripts\dashboard

    Can anyone please help me how can I set chrome driver using command prompt.



  • Define a local JMeter property this way:

    -J[prop_name]=[value]
    

    In your case it may be :

    jmeter -n -t WebDriverSampler.jmx -JChromeDriverPath=c:\soft\webdriver\chromedriver.exe
    

    Read defined properties in JMeter with function _P and use it in "Chrome" tab of jp@gc - Chrome Driver Config:

    ${__P(ChromeDriverPath)}
    

    You can pass and use any parameters this way.

    enter image description here

    Do not forget to put a default value in case you run the script without passing that JMeter property like:

    ${__P(ChromeDriverPath,c:\soft\webdriver\chromedriver.exe)}
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2