2

I'm trying to execute WebDriver sampler script from JMeter with WebDriver plugin and chrome-driver installed . The JMeter is configured to work in distributed mode. I currently have 2 nodes, one Master and one Slave. My script resides on master machine and I'm trying to execute it from Master machine using below command.

$JMETER_HOME/bin/jmeter -n -t recorder1.jmx -r

I receive this error:

2019-03-10 16:18:03,416 INFO o.a.j.s.BatchSampleSender: Using batching for this run. Thresholds: num=100, time=60000
2019-03-10 16:18:03,417 INFO o.a.j.s.DataStrippingSampleSender: Using DataStrippingSampleSender for this run with stripAlsoOnError: true
2019-03-10 16:18:03,417 INFO o.a.j.s.BatchSampleSender: Using batching for this run. Thresholds: num=100, time=60000
2019-03-10 16:18:03,418 INFO o.a.j.s.DataStrippingSampleSender: Using DataStrippingSampleSender for this run with stripAlsoOnError: true
2019-03-10 16:18:03,429 INFO o.a.j.e.RemoteJMeterEngineImpl: Creating JMeter engine on host xx.xxx.xxx.xx base '..'
2019-03-10 16:18:03,430 INFO o.a.j.e.RemoteJMeterEngineImpl: Remote client host: 10.xxx.xxx.xxx
2019-03-10 16:18:03,430 INFO o.a.j.s.FileServer: Set new base='..'
2019-03-10 16:18:03,431 INFO o.a.j.e.RemoteJMeterEngineImpl: Cleaning previously set properties: {}
2019-03-10 16:18:03,431 INFO o.a.j.e.StandardJMeterEngine: Applying properties {}
2019-03-10 16:18:03,431 INFO o.a.j.e.RemoteJMeterEngineImpl: Running test
2019-03-10 16:18:03,437 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2019-03-10 16:18:03,438 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2019-03-10 16:18:03,504 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2019-03-10 16:18:03,504 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2019-03-10 16:18:03,504 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-03-10 16:18:03,504 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2019-03-10 16:18:03,507 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-03-10 16:18:03,507 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-03-10 16:18:03,508 INFO o.a.j.t.JMeterThread: Thread started: xx.xxx.xxx.xx-Thread Group 1-1
2019-03-10 16:18:03,649 ERROR o.a.j.t.JMeterThread: Error calling threadStarted
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-1033-aws x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 111 milliseconds
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'jmeter-slave', ip: '10.xxx.xxx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1033-aws', java.version: '10.0.2'
Driver info: driver.version: ChromeDriver
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:488) ~[?:?]
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122) ~[selenium-remote-driver-3.14.0.jar:?]
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?]
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) ~[?:?]
    at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) ~[?:?]
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
    at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543) ~[?:?]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181) ~[selenium-chrome-driver-3.14.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:74) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:21) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:762) [ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1 r1853635]
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) [jorphan.jar:5.1 r1853635]
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:730) [ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:718) [ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249) [ApacheJMeter_core.jar:5.1 r1853635]
    at java.lang.Thread.run(Thread.java:844) [?:?]
2019-03-10 16:18:03,952 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'jp@gc - LoadWidgetAllInOne'.
java.lang.IllegalArgumentException: Browser has not been configured.  Please ensure at least 1 WebDriverConfig is created for a ThreadGroup.
    at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:62) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.1 r1853635]
    at java.lang.Thread.run(Thread.java:844) [?:?]
2019-03-10 16:18:03,957 INFO o.a.j.t.JMeterThread: Thread is done: xx.xxx.xxx.xx-Thread Group 1-1
2019-03-10 16:18:03,957 INFO o.a.j.t.JMeterThread: Thread finished: xx.xxx.xxx.xx-Thread Group 1-1
2019-03-10 16:18:03,969 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-03-10 16:18:03,969 INFO o.a.j.s.DataStrippingSampleSender: Test Ended on xx.xxx.xxx.xx
2019-03-10 16:18:03,969 INFO o.a.j.s.BatchSampleSender: Test Ended on xx.xxx.xxx.xx
2019-03-10 16:18:03,970 INFO o.a.j.s.DataStrippingSampleSender: Test Ended on xx.xxx.xxx.xx
2019-03-10 16:18:03,970 INFO o.a.j.s.BatchSampleSender: Test Ended on xx.xxx.xxx.xx
2019-03-10 16:18:03,971 INFO o.a.j.e.StandardJMeterEngine: Test has ended on host xx.xxx.xxx.xx

JMeter-Server runs under ubuntu user on Slave instance. I execute my test from Master machine also with ubuntu user. I saw that if chromedriver is executed with superuser it can cause the same issue like I have, but it's not the case.

The strangest thing is that if I execute the same script in headless mode it works fine. Also if I execute the same script from GUI or from command line on slave machine it also works fine without errors.

Installed:

  • EC2 instance with Ubuntu 18.04
  • apache-jmeter-5.1
  • ChromeDriver 2.45.615355
  • jmeter-plugins-webdriver-3.0.jar

Any ideas?

I also saw possible solution in: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

It's recommended there to add this code:

System.setProperty("webdriver.chrome.driver","pathto\\chromedriver.exe");    
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);

but how do I change chromedriver options before is is initialised in Chrome Driver Config step in JMeter?

1 Answers1

0
  1. According to what I see at ChromeDriver downloads page:

    Supports Chrome v70-72
    

    so make sure that Chrome version installed in Ubuntu is in the supported range

  2. Given the OS is Ubuntu server it should not have GUI while Chrome requires a DISPLAY to run at, either real or virtual. In both cases you should have DISPLAY variable defined and pointing to the real or virtual display.

  3. So first of all log into the machine exactly as you when running JMeter slave and launch /usr/bin/google-chrome as ubuntu user. If it starts without issues - you should be good to go, if not - you will need to fix the browser launching prior to attempting to use it from JMeter. You can double check the result of browser execution by verifying exit status - running the next command:

    echo $?
    

    if you see 0 - you're fine, if not - you have a problem.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Dmitri T, Thanks a lot for your response! Regarding #1: I have chrome version 72.03626.121 – Fred Shniper Mar 11 '19 at 13:38
  • Thanks a lot for your response! Regarding #1: I have chrome version 72.03626.121. I tried to change chromedriver to chromedriver=72.0.3626.69, it gives me the same results. #2,3 I have VNC/X11 installed on the machine. It opens chrome browser if I execute `/usr/bin/google-chrome` command while I'm in VNC screen. – Fred Shniper Mar 11 '19 at 13:44