I'm writing Selenium test scripts using Java for an application built in ExtJs. I have an input field in one of the page which is attached to 'onchange' event. Whenever user modifies the text in the field, onchange event is triggered. I'm using WebDriver sendKeys() to modify the text in the field. So whenever text is modified, 'onchange' event is triggered in Firefox and Chrome (as expected) but its not getting triggered in IE9.0. I have searched all over the net for the solution, but didn't find one. So please can someone help me on this? Let me know more info is required
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- Selecting an item from a combo box selenium driver
- Is TWebBrowser dependant on IE version?
- Selenium in Java is not finding element when using
- How to send text to the search field through Selen
You can either click on a different element on the field, or perhaps the easier way is to tab off of the field after the input is finished.
In the ExtJS applications I've automated, I'll always tab off of the field after performing the input, which fires all of the correct events.
Using C# as an example:
I believe this is due to the fact that IE triggers onchange only after onblur. Meaning you will need to force the input field to loose focus. The simplest way to do this is to click another element.
I got this issue fixed. 'onchange' event was not getting triggered only in certain scenarios. If the input text is same as the text which already exists in textfield then onchange event is not triggered through sendKey(). But the same code is working fine for FF and Chrome browsers. I just made sure to clear and add whitespace before setting new text in the textfield for ie browsers and its working. Thanks guys for the response!