title: Selenium scripts gets failed in jenkins but works fine in local
body: <p>My selenium java scripts are running fine in local but gets failed in jenkins. For example:</p>
  
  <pre><code>driver.findElement(By.xpath("//div[@id='IDName']")).click();//loads a new page
  driver.findElement(By.xpath("//div[@id='TextBox']"))).sendKeys("xyz");
  </code></pre>
  
  <p>After running scripts like this in jenkins am getting error as <code>Unable to locate element: "//div[@id='TextBox']"</code>. But when I run same script again in jenkins it gets passed. I can understand this is due to the page is not loading properly. Am using the following command in base class.</p>
  
  <pre><code>driver.manage().timeouts().implicitlyWait(_TIMEOUT, TimeUnit.SECONDS);//_TIMEOUT = 50;
  </code></pre>
  
  <p>I can add <code>Thread.sleep()</code> or <code>driver.wait()</code> between the click and sendkeys lines, but I don't think its a good idea since I have more than 600 scripts to execute. </p>