title: Selenium WebDriver By.xpath doesn't work all the time
body: <p><strong>Info :</strong> </p>
  
  <p>I get <code>fieldXpath</code> from a config file, and it is  <code>"//input[@id='signin_password']"</code></p>
  
  <p><strong>HTML :</strong> </p>
  
  <pre><code>&lt;li&gt;&lt;input type="password" name="signin[password]" id="signin_password" /&gt;&lt;/li&gt;
  </code></pre>
  
  <p><strong>WORKS</strong> : <strong>(but not always)</strong></p>
  
  <p>Gets in the catch ...</p>
  
  <pre><code>public void doAction(WebDriver driver) throws TestException {
          try {
               WebElement el = driver.findElement(By.xpath(fieldXpath));
               el.clear();
               el.sendKeys(fieldValue);
           } catch (Exception e) {
              throw new TestException(this.getClass().getSimpleName() + ": problem while doing action : " + toString());
           }
      }
  </code></pre>
  
  <p>Does a solution that makes this code work with XPath? </p>