title: Selenium WebDriver cannot locate element within an iframe, and throws NoSuchElementException
body: <p>I realise there are several queries on here for this same problem but none of them provide a solution to my particular problem. </p>
  
  <p>I am running a web driver test that tries to fill out a form for a mail website to find postcodes based on address details. I keep getting this error when trying to locate the first text box:</p>
  
  <pre><code>org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":"#ctl00_BodyContent_txtBuildingNumber"}
  </code></pre>
  
  <p>I have used xpath and the id to try and locate the element but I keep getting the error. I can see that this element is present when the webdriver is running and I have been able to locate another text element on the page and enter text, but I keep getting this error for this field and other fields within the frame.</p>
  
  <p>I am guessing that the problem must be to do with the fact that this field is part of an iFrame.</p>
  
  <p>I have used implicit waits within the test but with no success. I still get the error.</p>