1

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.

1 Answer 1

1

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)}
3
  • 1
    So, I have to use like this ${__P(ChromeDriverPath,c:\soft\webdriver\chromedriver.exe)} in path to chrome driver ??
    – Rajan
    Commented Apr 8, 2020 at 13:24
  • Indeed, just try now) Commented Apr 8, 2020 at 13:30
  • 1
    Yes I have tried it before like this, but that didn't work ,,,,now I used only like this __P(chromeDriverPath) and in command prompt I used like this jmeter -n -t D:\JmeterSeleniumScripts\LCOrderSummryReport.jmx -l D:\JmeterSeleniumScripts\lcOrderSummaryResults.jtl -f -e -o D:\JmeterSeleniumScripts\dashboard -JUsers=4 -JRampUp=8 -JchromePathDriver=D:\chromeDriverForJmeter\chromedriver.exe and it's work fine now !!
    – Rajan
    Commented Apr 8, 2020 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.