title: Webdriver - Unable to locate element (Java)
body: <p>I'm new in Selenium and WebDriver.
  I have this HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input id="undefined-undefined-Jobsubject-5546" type="text" value="" data-test="testing-job-subject" style="padding: 0px; position: relative; width: 100%; border: medium none; outline: medium none; background-color: transparent; color: rgb(255, 255, 255); cursor: initial; font: inherit; height: 100%; box-sizing: border-box; margin-top: 14px;"/&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and I have this code:</p>
  
  <pre><code>driver.findElement(By.xpath("//input[@data-test='testing-job-subject']"));
  </code></pre>
  
  <p>but the error is:</p>
  
  <blockquote>
    <p>org.openqa.selenium.NoSuchElementException: Unable to locate element: //input[@data-test='testing-job-subject'] </p>
  </blockquote>
  
  <p>I tried also this:</p>
  
  <pre><code>driver.findElement(By.xpath("//*[starts-with(@id,'undefined-undefined-Jobsubject')]"));
  </code></pre>
  
  <p>because the number in id is generated, so I can't take the By.id(....), but the same error.
  And yes,I have in the code the timeouts,so the element is on the page. </p>
  
  <p>Where is the problem? Thanks</p>