title: Webdriver grid run tests on different browsers
body: <p>I am trying to distribute my tests on different browsers (in the same node) I am using Selenium Grid.</p>
  
  <p>Here is my code  :</p>
  
  <pre><code>@Parameters("browser")
  @BeforeTest
  
  public void setup (String browser) throws IOException  
  
  {
      File file = new File("config.properties");
      FileInputStream fileInput = new FileInputStream(file);
      Properties properties = new Properties();
      properties.load(fileInput);
      fileInput.close();
      TestURL = properties.getProperty("AppURL");
      BaseURL = properties.getProperty("HubURL");
      winURL = properties.getProperty("WinURL");
  
  
  
  
  
          DesiredCapabilities capability=null;
  
          if(browser.equalsIgnoreCase("firefox")){
              System.out.println("firefox");
              capability= DesiredCapabilities.firefox();
              capability.setBrowserName("firefox"); 
              capability.setPlatform(Platform.WINDOWS);
              //capability.setVersion("");
          }
  
          if(browser.equalsIgnoreCase("chrome")){
              File chromedriver = new File("C:\\grid\\chromedriver_win32_2.3");
              System.setProperty("webdriver.chrome.driver", chromedriver.getAbsolutePath());
              System.out.println("chrome");
              capability= DesiredCapabilities.chrome();
              capability.setBrowserName("chrome"); 
              capability.setPlatform(Platform.WINDOWS);
  
  
              //capability.setVersion("");
          }
  
  
      driver = new RemoteWebDriver ( new URL ( winURL ),  capability) ;
      driver.get(TestURL);
        WebElement input1 = driver.findElement(By.id("login_form_user_input"));
        input1.sendKeys("guest");
        WebElement input2 = driver.findElement(By.id("login_form_password_input"));
        input2.sendKeys("guest");
        WebElement btn = driver.findElement(By.id("login_form_signin_button"));
        btn.click();
  
  
  
  
  
  
  }
  </code></pre>
  
  <p>And here is my testng.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     &lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt;
         &lt;suite name="Basic Web Elements" thread-count="2" parallel="tests" &gt;
         &lt;test name="Home Page load time on firefox"&gt;
      &lt;parameter name="browser" value="firefox"/&gt;
      &lt;classes&gt;
          &lt;class name="basicWebElements.HomePage" /&gt;
      &lt;/classes&gt;
  &lt;/test&gt;
  &lt;test name="Home Page load time on Internet Explorer"&gt;
      &lt;parameter name="browser" value="chrome"/&gt;
      &lt;classes&gt;
          &lt;class name="basicWebElements.HomePage" /&gt;
      &lt;/classes&gt;
  &lt;/test&gt;
   &lt;/suite&gt; 
  </code></pre>
  
  <p>However when I run testng XML i get this error :
  org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see <a href="http://code.google.com/p/selenium/wiki/ChromeDriver" rel="nofollow">http://code.google.com/p/selenium/wiki/ChromeDriver</a>. The latest version can be downloaded from <a href="http://code.google.com/p/chromedriver/downloads/list" rel="nofollow">http://code.google.com/p/chromedriver/downloads/list</a></p>
  
  <p>Please not that my chromedriver is saved in my node in the path mentioned in the code above and that my ENV variable PATH is pointing to the driver exec file.</p>
  
  <p>I am launching my hub by executing this batch file :</p>
  
  <pre><code>set HERE=%CD%
  set JAVA_HOME=%HERE%\jdk1.7.0_40
  set PATH=%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%PATH%
  set SELENIUM_VERSION=2.35.0
  set CHROME_VERSION=chromedriver_win32_2.3
  set HUB_URL=http://localhost:4444/grid/register
  start java -jar selenium-server-standalone-%SELENIUM_VERSION%.jar  -role hub 
  </code></pre>
  
  <p>And launching my node this way :</p>
  
  <pre><code>java -jar selenium-server-standalone-2.35.0.jar -role webdriver -hub   http://*.*.*.*:4444/grid/register  -port 5556
  </code></pre>
  
  <p>I am out of ideas why my tests are running fine on Firefox but not in Chrome.</p>