title: Configure Jenkins to use Chrome - Selenium 3.0.1 Maven TestNG
body: <p>I've been trying to get Jenkins to use Chrome for my automated tests. When I run the tests locally I am able to get it to use Chrome by -Dbrowser=chrome in JDK VM options for TestNG.</p>
  <p><a href="https://i.stack.imgur.com/pcnfW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pcnfW.jpg" alt="enter image description here" /></a></p>
  <p>For some reason it seems to be stuck on using Firefox no matter what I try.</p>
  <p>Here is my before method</p>
  <pre><code>@BeforeMethod(
      alwaysRun = true
  )
  public static void configureBrowserBeforeTest(Method testMethod) {
      try {
          ((Driver)driver.get()).resetBrowser();
          wait.set(newDefaultWait());
          userAgent = determineUserAgent();
          initialiseNewScreenshotCapture(testMethod);
      } catch (Exception var2) {
          logger.error(&quot;Failed to configure browser.&quot;, var2);
          throw new RuntimeException(&quot;Failed to configure browser.&quot;, var2);
      }
  }
  </code></pre>
  <p>And POM File</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.frameworkium&lt;/groupId&gt;
      &lt;artifactId&gt;Frameworkium&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;2.0.5&lt;/version&gt;
  
      &lt;name&gt;Frameworkium&lt;/name&gt;
      &lt;description&gt;
          A template designed to get up and running quickly with Selenium and Appium.
      &lt;/description&gt;
      &lt;url/&gt;
      &lt;inceptionYear/&gt;
      &lt;organization/&gt;
      &lt;licenses/&gt;
  
      &lt;developers/&gt;
      &lt;contributors/&gt;
  
      &lt;prerequisites&gt;
          &lt;maven&gt;3.1.1&lt;/maven&gt;
      &lt;/prerequisites&gt;
  
      &lt;modules/&gt;
  
      &lt;scm/&gt;
      &lt;issueManagement/&gt;
      &lt;ciManagement/&gt;
      &lt;distributionManagement/&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;env.config&gt;local&lt;/env.config&gt;
          &lt;threads&gt;1&lt;/threads&gt;
          &lt;groups/&gt;
          &lt;aspectj.version&gt;1.8.9&lt;/aspectj.version&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;jitpack.io&lt;/id&gt;
              &lt;url&gt;https://jitpack.io&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.testng&lt;/groupId&gt;
              &lt;artifactId&gt;testng&lt;/artifactId&gt;
              &lt;version&gt;6.9.8&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
              &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
              &lt;version&gt;3.11&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
              &lt;artifactId&gt;poi&lt;/artifactId&gt;
              &lt;version&gt;3.14&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.github.Frameworkium&lt;/groupId&gt;
              &lt;artifactId&gt;frameworkium-core&lt;/artifactId&gt;
              &lt;version&gt;2.3.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-remote-driver&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-server&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;testSourceDirectory&gt;src/test/java&lt;/testSourceDirectory&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;
                      src/main/resources
                  &lt;/directory&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
      &lt;/build&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;tests&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;build&gt;
  
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                          &lt;version&gt;3.5.1&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;source&gt;1.8&lt;/source&gt;
                              &lt;target&gt;1.8&lt;/target&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.19.1&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;parallel&gt;methods&lt;/parallel&gt;
                              &lt;threadCount&gt;${threads}&lt;/threadCount&gt;
                              &lt;systemProperties&gt;
                                  &lt;screenshotDirectory&gt;
                                      ${project.build.directory}/screenshots
                                  &lt;/screenshotDirectory&gt;
                                  &lt;allure.issues.tracker.pattern&gt;
                                      /browse/%s
                                  &lt;/allure.issues.tracker.pattern&gt;
                              &lt;/systemProperties&gt;
                              &lt;suiteXmlFiles&gt;
                                  &lt;suiteXmlFile&gt;testng.xml&lt;/suiteXmlFile&gt;
                              &lt;/suiteXmlFiles&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;**/Test*.java&lt;/include&gt;
                                  &lt;include&gt;**/*Tests*.java&lt;/include&gt;
                                  &lt;include&gt;**/*Tests.java&lt;/include&gt;
                                  &lt;include&gt;**/*Test.java&lt;/include&gt;
                                  &lt;include&gt;**/*TestCase.java&lt;/include&gt;
                              &lt;/includes&gt;
                              &lt;groups&gt;${groups}&lt;/groups&gt;
                              &lt;testFailureIgnore&gt;false&lt;/testFailureIgnore&gt;
                              &lt;argLine&gt;
                                  -javaagent:&quot;${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar&quot;
                              &lt;/argLine&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
  
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/tBUU9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tBUU9.jpg" alt="enter image description here" /></a></p>
  <p>I'm sure the solution is something simple, I have Jenkins running as a service and using a local admin account. I have installed the chromedriver plugin for jenkins as well as the Selenium plugin. The tests are being found OK but they are using Firefox and FF version 50 doesnt seem to work with the gecko driver on Selenium 3.0.1,  so I would rather use Chrome which I know works just fine but for the life of me I cant figure out how to tell Jenkins to use Chrome instead of FF. Thanks in advance for your help! And apologies if I've missed anything out.</p>
  <p>OS - Windows Server 2012
  Maven
  TestNG
  Selenium 3.0.1</p>