Note that there are some explanatory texts on larger screens.

plurals
  1. POdatepicker + webdriver + unable to identify the element
    primarykey
    data
    text
    <p>In my application i have a text box which when i click brings the date picker to select a date. One way is to select the date from datepicker or u can manually send in the date. But whenever i send in the date it says it is unable to locate the element.</p> <p>THis is code for sending the date to the text box</p> <pre><code>driver.findElement(By.xpath(".//*[@id='txtdateFrom']")).sendKeys("03/05/2013"); </code></pre> <p>It throws the following error</p> <pre><code>org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":".//*[@id='txtdateFrom']"} Command duration or timeout: 15 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59' System info: os.name: 'Windows 8', os.arch: 'x86', os.version: '6.2', java.version: '1.7.0_17' Session ID: 3eea4ac2-2b38-4688-9733-8734077f7d3e Driver info: org.openqa.selenium.firefox.FirefoxDriver </code></pre> <p>I dont have the privilege to add the screenshot. Please help!!</p> <p>Please find the HTML below</p> <pre><code>&lt;input id="txtdateFrom" class="textbox hasDatepicker" type="text" style="color:Gray;" name="txtdateFrom"&gt; </code></pre> <p>Please find the iframe HTMl</p> <pre><code>&lt;iframe width="100%" scrolling="auto" height="493" frameborder="1" style="vertical-align: top;" allowtransparency="true" id="ContentMain" src="../Report/AuditorAssignmentReportSearch.aspx?Width=100&amp;amp;Height=528"&gt;&lt;/iframe&gt; </code></pre> <p>DOM of the text field which when clicked will populate datepicker</p> <pre><code> attributes [type="text", style="color:Gray;", 2 more...] 0 type="text" 1 style="color:Gray;" 2 class="textbox hasDatepicker" 3 id="txtdateFrom" 4 name="txtdateFrom" </code></pre> <p>and this is the attribute of the datepicker once the text field is clicked</p> <pre><code>attributes [class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all"] 0 class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all" </code></pre> <p>Updated DOM</p> <pre><code>attributes [onclick="DP_jQuery_1368459704950.datepicker._selectDay('#txtdateFrom',4,2013, this);return false;", class= " ui-datepicker-today" ] 0 onclick="DP_jQuery_1368459704950.datepicker._selectDay('#txtdateFrom',4,2013, this);return false;" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload