I have a text box with an onkeypress event that renders the page when I enter a value in the text box. Here I use selenium webdriver to populate a text box. Before filling in the text box, I use textbox.clear (). In this way, the onkeypress event is fired and the page gets rendered. Thus, the text box control is removed from the webdriver instance.
After the onkeypress event, this element does not fall into the webdriver list. This is the source tag of a specific text field:
<input id="ctl00_ctl00_ContentPlaceHolder1_cphMainContent_wzrDREvent_txtNftnTime" class="OpCenter_DateBox" type="text" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ctl00$ContentPlaceHolder1$cphMainContent$wzrDREvent$txtNftnTime\',\'\')', 0)" name="ctl00$ctl00$ContentPlaceHolder1$cphMainContent$wzrDREvent$txtNftnTime">
And you can see the onkeypress event here. Please suggest some ideas for filling in the values in the text box.
I use the following code to populate my text box:
element.Clear();
element.SendKeys(value);
Thanks in advance.
Naren source
share