When I enter text in a text field, or interact with something on a page, there is a JavaScript?

Wiki: FrequentQuestions: "Q. When I enter text in a text field, or interact with something on a page, there is a JavaScript? event that is triggered by mouse movements. How do I get Watir to trigger these events?

A. If the tag contains a JavaScript? call, you can use the 'fire_event' method to trigger it. ex. onchange=doThis() or onmouseup=clearForm()
To trigger a text field named 'my_field' with an onchange event we would do this with Watir:
ie.text_field(:name, 'my_field').fire_event('onchange')"

No comments:

Ramadan - What is it?

  Ramadan is one of the most important and holy months in the Islamic calendar. It is a time of fasting, prayer, and spiritual reflection fo...