How to not wait for something with Watir-Webdriver

前端 未结 3 702
不思量自难忘°
不思量自难忘° 2021-01-23 10:26

So I\'m writing a watir-webdriver script, and my app is using javascript to present a modal window that I want to interact with. When I click the element that presents the modal

3条回答
  •  萌比男神i
    2021-01-23 11:02

    Ruby 1.9.3/ IE 9 - I had a click_no_wait error. Watir would not trigger a click on the Save button, which had to be followed by a click on a java popup 'OK' button that confirmed that the save button had saved the document correctly.

    Using these two lines in place of the click_no_wait command gets the code working perfectly:

    element.focus 
    element.send_keys :return
    

    Thanks DVG. My code -

    ie.button(:id, 'MainContent_B_Save').focus
    ie.button(:id, 'MainContent_B_Save').send_keys :return 
    ie. javascript_dialog.button('OK').click
    

提交回复
热议问题