title: How to resolve JMeter ERROR c.g.j.p.w.s.WebDriverSampler: null?
body: <p>I'm using JMeter in NON-GUI mode to execute tests from a Docker container. My test uses Selenium web driver with Chrome. I'm having an error that shows in <code>jmeter.log</code> but I don't know how to resolve it. </p>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>ERROR c.g.j.p.w.s.WebDriverSampler: null</p>
  </blockquote>
  
  <p>When I run the test locally in my computer the test executes correctly, but in Docker using JMeter non-gui mode it doesn't work.</p>
  
  <p>Test configuration in local JMeter:</p>
  
  <p><a href="https://i.stack.imgur.com/Yhzfj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yhzfj.png" alt="Test a configuration in local"></a></p>
  
  <p>Execution in Docker:</p>
  
  <p><a href="https://i.stack.imgur.com/GJrzW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GJrzW.png" alt="Execution in non-gui mode"></a></p>
  
  <p>Log fragment with error</p>
  
  <p><a href="https://i.stack.imgur.com/IB3hC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IB3hC.png" alt="Log fragment with error"></a></p>
  
  <h2>Edit</h2>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM  anapsix/alpine-java:8_jdk
  LABEL maintainer="origds@gmail.com"
  STOPSIGNAL SIGKILL
  ENV JMETER_VERSION 5.1.1
  ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
  ENV JMETER_BIN ${JMETER_HOME}/bin
  ENV PATH ${JMETER_BIN}:$PATH
  COPY entrypoint.sh /usr/local/bin/
  RUN chmod +x /usr/local/bin/entrypoint.sh \
   &amp;&amp; apk add --no-cache \
      curl \
      net-tools \
      shadow \
      su-exec \
      tcpdump  \
   &amp;&amp; cd /tmp/ \
   &amp;&amp; curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz \
   &amp;&amp; curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz.sha512 https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz.sha512 \
   &amp;&amp; sha512sum -c apache-jmeter-${JMETER_VERSION}.tgz.sha512 \
   &amp;&amp; mkdir -p /opt/ \
   &amp;&amp; tar x -z -f apache-jmeter-${JMETER_VERSION}.tgz -C /opt \
   &amp;&amp; rm -R -f apache* \
   &amp;&amp; sed -i '/RUN_IN_DOCKER/s/^# //g' ${JMETER_BIN}/jmeter \
   &amp;&amp; sed -i '/PrintGCDetails/s/^# /: "${/g' ${JMETER_BIN}/jmeter \
   &amp;&amp; sed -i '/PrintGCDetails/s/$/}"/g' ${JMETER_BIN}/jmeter \
   &amp;&amp; chmod +x ${JMETER_HOME}/bin/*.sh \
   &amp;&amp; jmeter --version \
   &amp;&amp; rm -fr /tmp/*
  WORKDIR /jmeter
  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  CMD ["jmeter", "--?"]
  
  ## JMETER plugins
  ENV JMETER_PLUGINS_MANAGER_VERSION 1.3
  ENV CMDRUNNER_VERSION 2.2
  ENV JSON_LIB_VERSION 2.4
  ENV JSON_LIB_FULL_VERSION ${JSON_LIB_VERSION}-jdk15
  ENV NUMBER_OF_FILES_UNDER_LIB 144
  ENV NUMBER_OF_FILES_UNDER_LIB_EXT 74
  RUN cd /tmp/ \
   &amp;&amp; curl --location --silent --show-error --output ${JMETER_HOME}/lib/ext/jmeter-plugins-manager-${JMETER_PLUGINS_MANAGER_VERSION}.jar http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/${JMETER_PLUGINS_MANAGER_VERSION}/jmeter-plugins-manager-${JMETER_PLUGINS_MANAGER_VERSION}.jar \
   &amp;&amp; curl --location --silent --show-error --output ${JMETER_HOME}/lib/cmdrunner-${CMDRUNNER_VERSION}.jar http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/${CMDRUNNER_VERSION}/cmdrunner-${CMDRUNNER_VERSION}.jar \
   &amp;&amp; curl --location --silent --show-error --output ${JMETER_HOME}/lib/json-lib-${JSON_LIB_FULL_VERSION}.jar https://search.maven.org/remotecontent?filepath=net/sf/json-lib/json-lib/${JSON_LIB_VERSION}/json-lib-${JSON_LIB_FULL_VERSION}.jar \
   &amp;&amp; java -cp ${JMETER_HOME}/lib/ext/jmeter-plugins-manager-${JMETER_PLUGINS_MANAGER_VERSION}.jar org.jmeterplugins.repository.PluginManagerCMDInstaller \
   &amp;&amp; PluginsManagerCMD.sh install \
  blazemeter-debugger=0.6,\
  bzm-hls=1.2,\
  bzm-http2=1.4,\
  bzm-parallel=0.9,\
  bzm-random-csv=0.6,\
  bzm-rte=1.0.4,\
  bzm-siebel=0.1.0-beta,\
  custom-soap=1.3.3,\
  jmeter.backendlistener.elasticsearch=2.6.0,\
  jpgc-autostop=0.1,\
  jpgc-casutg=2.8,\
  jpgc-cmd=2.2,\
  jpgc-csl=0.1,\
  jpgc-csvars=0.1,\
  jpgc-dbmon=0.1,\
  jpgc-directory-listing=0.2,\
  jpgc-dummy=0.2,\
  jpgc-ffw=2.0,\
  jpgc-fifo=0.2,\
  jpgc-filterresults=2.2,\
  jpgc-functions=2.1,\
  jpgc-ggl=2.0,\
  jpgc-graphs-additional=2.0,\
  jpgc-graphs-basic=2.0,\
  jpgc-graphs-composite=2.0,\
  jpgc-graphs-dist=2.0,\
  jpgc-graphs-vs=2.0,\
  jpgc-hadoop=2.0,\
  jpgc-httpraw=0.1,\
  jpgc-jms=0.2,\
  jpgc-jmxmon=0.2,\
  jpgc-json=2.7,\
  jpgc-lockfile=0.1,\
  jpgc-mergeresults=2.1,\
  # jpgc-oauth=0.1,\
  jpgc-pde=0.1,\
  jpgc-perfmon=2.1,\
  jpgc-plancheck=2.4,\
  # jpgc-plugins-manager=${JMETER_PLUGINS_MANAGER_VERSION},\
  jpgc-prmctl=0.4,\
  jpgc-redis=0.3,\
  jpgc-rotating-listener=0.2,\
  jpgc-sense=3.5,\
  jpgc-standard=2.0,\
  jpgc-sts=2.4,\
  jpgc-synthesis=2.2,\
  jpgc-tst=2.5,\
  jpgc-udp=0.4,\
  jpgc-webdriver=3.0,\
  jpgc-wsc=0.7,\
  jpgc-xml=0.1,\
  jpgc-xmpp=1.5.1,\
  kafkameter=0.2.0,\
  mqtt-sampler=0.0.1-SNAPSHOT,\
  netflix-cassandra=0.2-SNAPSHOT,\
  ssh-sampler=1.1.1-SNAPSHOT,\
  tilln-sshmon=1.1,\
  tilln-wssecurity=1.6,\
  websocket-sampler=1.0.2-SNAPSHOT,\
  websocket-samplers=1.2.1 \
   &amp;&amp; jmeter --version \
   &amp;&amp; PluginsManagerCMD.sh status \
   &amp;&amp; chmod +x ${JMETER_HOME}/bin/*.sh \
   &amp;&amp; if [ `ls -l /opt/apache-jmeter-*/lib/ | wc -l` != ${NUMBER_OF_FILES_UNDER_LIB} ]; then exit -1; fi \
   &amp;&amp; if [ `ls -l /opt/apache-jmeter-*/lib/ext/ | wc -l` != ${NUMBER_OF_FILES_UNDER_LIB_EXT} ]; then exit -1; fi \
   &amp;&amp; rm -fr /tmp/*
  
  # Install Gecko Driver
  RUN curl -sL "https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz" | \
      tar -xz -C ${JMETER_HOME}/bin
  
  #Install Chromium and ChromeDriver
  RUN \
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" &gt;&gt; /etc/apk/repositories \
    &amp;&amp; echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" &gt;&gt; /etc/apk/repositories \
    &amp;&amp; echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" &gt;&gt; /etc/apk/repositories \
    &amp;&amp; apk --no-cache  update \
    &amp;&amp; apk --no-cache  upgrade \
    &amp;&amp; apk add --no-cache --virtual .build-deps gifsicle pngquant optipng libjpeg-turbo-utils udev ttf-opensans chromium \
    &amp;&amp; rm -rf /var/cache/apk/* /tmp/* /usr/include
  RUN apk add chromium-chromedriver
  RUN cp /usr/bin/chromedriver ${JMETER_HOME}/bin
  COPY ./workaround.sh /tmp/workaround.sh
  RUN chmod +x /tmp/workaround.sh
  RUN cp /tmp/workaround.sh ${JMETER_HOME}/bin
  
  # Install vnc, xvfb in order to create a 'fake' display and firefox
  RUN sed -i -e 's/v[[:digit:]]\.[[:digit:]]/edge/g' /etc/apk/repositories
  RUN apk update
  RUN apk upgrade
  RUN apk add x11vnc
  RUN apk add xvfb
  RUN apk add firefox --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
  RUN apk --no-cache add ca-certificates
  RUN     mkdir ~/.vnc
  # Setup a password
  RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
  
  # Install new guava version
  RUN wget "http://search.maven.org/remotecontent?filepath=com/google/guava/guava/23.0/guava-23.0.jar" -O "guava-23.0.jar"
  RUN su 
  RUN mv ./guava-23.0.jar ${JMETER_HOME}/lib
  RUN rm ${JMETER_HOME}/lib/guava-19.0.0.jar
  RUN exit
  </code></pre>
  
  <p>jmeter.log</p>
  
  <pre><code>2019-06-29 11:55:40,517 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
  2019-06-29 11:55:40,565 INFO o.a.j.JMeter: Loading user properties from: /opt/apache-jmeter-5.1.1/bin/user.properties
  2019-06-29 11:55:40,565 INFO o.a.j.JMeter: Loading system properties from: /opt/apache-jmeter-5.1.1/bin/system.properties
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: Copyright (c) 1998-2019 The Apache Software Foundation
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: Version 5.1.1 r1855137
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: java.version=1.8.0_202
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: os.name=Linux
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: os.arch=amd64
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: os.version=4.9.125-linuxkit
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: file.encoding=UTF-8
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: java.awt.headless=true
  2019-06-29 11:55:40,576 INFO o.a.j.JMeter: Max memory     =1073741824
  2019-06-29 11:55:40,577 INFO o.a.j.JMeter: Available Processors =2
  2019-06-29 11:55:40,585 INFO o.a.j.JMeter: Default Locale=English (EN)
  2019-06-29 11:55:40,585 INFO o.a.j.JMeter: JMeter  Locale=English (EN)
  2019-06-29 11:55:40,585 INFO o.a.j.JMeter: JMeterHome=/opt/apache-jmeter-5.1.1
  2019-06-29 11:55:40,585 INFO o.a.j.JMeter: user.dir  =/jmeter
  2019-06-29 11:55:40,586 INFO o.a.j.JMeter: PWD       =/jmeter
  2019-06-29 11:55:40,586 INFO o.a.j.JMeter: IP: 172.17.0.2 Name: e31d62320a47 FullName: e31d62320a47
  2019-06-29 11:55:40,596 INFO o.a.j.s.FileServer: Default base='/jmeter'
  2019-06-29 11:55:40,612 INFO o.a.j.s.FileServer: Set new base='/workspace'
  2019-06-29 11:55:40,917 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
  2019-06-29 11:55:40,947 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
  2019-06-29 11:55:40,957 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0
  2019-06-29 11:55:40,973 INFO o.a.j.s.SaveService: Loading file: /workspace/login_test_chrome.jmx
  2019-06-29 11:55:41,058 INFO o.a.j.p.h.c.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_
  2019-06-29 11:55:41,087 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
  2019-06-29 11:55:41,087 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
  2019-06-29 11:55:41,088 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
  2019-06-29 11:55:41,088 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
  2019-06-29 11:55:41,153 INFO o.a.j.JMeter: Creating summariser &lt;summary&gt;
  2019-06-29 11:55:41,171 INFO o.a.j.e.StandardJMeterEngine: Running the test!
  2019-06-29 11:55:41,172 INFO o.a.j.s.SampleEvent: List of sample_variables: []
  2019-06-29 11:55:41,172 INFO o.a.j.s.SampleEvent: List of sample_variables: []
  2019-06-29 11:55:41,190 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.'
  2019-06-29 11:55:41,190 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
  2019-06-29 11:55:41,504 INFO o.a.j.JMeter: Running test (1561809341503)
  2019-06-29 11:55:41,543 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
  2019-06-29 11:55:41,543 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
  2019-06-29 11:55:41,543 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
  2019-06-29 11:55:41,544 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
  2019-06-29 11:55:41,567 INFO o.a.j.t.ThreadGroup: Started thread group number 1
  2019-06-29 11:55:41,567 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
  2019-06-29 11:55:41,573 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
  2019-06-29 11:55:43,052 ERROR c.g.j.p.w.s.WebDriverSampler: null
  2019-06-29 11:55:43,100 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
  2019-06-29 11:55:43,100 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
  2019-06-29 11:55:43,184 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
  2019-06-29 11:55:43,186 INFO o.a.j.r.Summariser: summary =      1 in 00:00:02 =    0.6/s Avg:     0 Min:     0 Max:     0 Err:     1 (100.00%)
  </code></pre>
  
  <p>I'm using these versions:</p>
  
  <ul>
  <li>ChromeDriver 73.0.3683.103 </li>
  <li>Chromium 73.0.3683.103 </li>
  </ul>
  
  <p>Test Code:</p>
  
  <pre><code>var pkg = JavaImporter(org.openqa.selenium); //WebDriver classes
  var support_ui = 
  JavaImporter(org.openqa.selenium.support.ui.WebDriverWait); 
  //WebDriver classes
  var wait = new support_ui.WebDriverWait(WDS.browser, 5000);
  
  WDS.sampleResult.sampleStart(); //captures sampler's start time
  WDS.sampleResult.getLatency();
  WDS.log.info("Sample started");
  
  WDS.browser.get('http://192.168.1.68:80/login/index.php'); //opens 
  website specified in 'localhost' docker 
  WDS.log.info("Navegación hasta login Aula Virtual UV");
  
  var usernameField = WDS.browser.findElement(pkg.By.id('username'));  
  //username
  usernameField.click(); //click s search field
  usernameField.sendKeys(['user']);
  WDS.log.info("username 'user' wrote");
  
  var passwordField = WDS.browser.findElement(pkg.By.id('password')); 
  //password
  passwordField.click(); //Click Search Button
  passwordField.sendKeys(['bitnami']);
  WDS.log.info("password wrote");
  
  var loginButton = WDS.browser.findElement(pkg.By.id('loginbtn')); 
  //login button
  loginButton.click(); //Click Login Button
  WDS.log.info("Clicked on the login button");
  
  WDS.sampleResult.sampleEnd
  WDS.quit(); 
  </code></pre>