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
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.
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)}
-
1So, I have to use like this
${__P(ChromeDriverPath,c:\soft\webdriver\chromedriver.exe)}
in path to chrome driver ??Rajan– Rajan2020年04月08日 13:24:22 +00:00Commented Apr 8, 2020 at 13:24 -
Indeed, just try now)Vadim Yangunaev– Vadim Yangunaev2020年04月08日 13:30:04 +00:00Commented Apr 8, 2020 at 13:30
-
1Yes 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 thisjmeter -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– Rajan2020年04月08日 13:31:59 +00:00Commented Apr 8, 2020 at 13:31