Ever right-click on a link and it shows javascript://? You won’t be able to do the usual link.click in Watir.
Solution: Use the fire_event call. Below is an example of clicking a link that executes a javascript command to open a new window.
$ie.link(:text, “Help”).fire_event(”onclick”)
$ie = Instance of Internet Explorer
Link has a text value of “Help”.
Fire the event on mouse click.
Another example:
ie.text_field(:name, "my_field").fire_event("onchange")

You must log in to post a comment.