URL: http://selenium-client.rubyforge.org
wait_for commands
For convenience, here are direct links to the documentation of the Selenium-Ruby wait_for commands that are most often used. The documentation of WaitFor commands in Selenium Core may also be of interest.
wait_for_conditionwait_for_elementwait_for_field_valuewait_for_frame_to_loadwait_for_no_elementwait_for_no_field_valuewait_for_no_textwait_for_pagewait_for_page_to_loadwait_for_popupwait_for_text
More information onwait_for with the Ruby client, including a complete list of the wait_for commands available in the Ruby client, is to be found in the documentation for the Selenium-Client Ruby Gem. As Selenium-Client defines many "idiomatic" Ruby aliases for built-in Selenium methods, it will probably be especially helpful to become familiar with the Selenium Ruby driver command set as well as Selenium-Client's Idiomatic Ruby command set.
It may also be helpful to refer to the documentation for Selenium Core with regard to WaitForCondition and related commands. In general the Selenium Core documentation tends to provide more insight into how commands work, than does the documentation for any of the drivers.
Below are a couple of examples of using Selenium's wait_for family of commands with the Ruby driver (Selenium-Client).
One item of note is that , within wait_for_condition, one does not need to use this.browserbot.getCurrentWindow() to access the DOM of the AUT
@selenium.wait_for_element "//div[@id='foo']" # if the application under test uses jQuery, then you can do @selenium.wait_for_condition "$('#foo').css('display') == 'block'", 2 # otoh if jQuery is not available, use native DOM methods: @selenium.wait_for_condition "document.getElementById('foo').style.display == 'block'", 2 # Note that, within wait_for_condition, I did NOT need to use # this.browserbot.getCurrentWindow().$() and instead I could # simply refer to $()
You need to login to post a comment.
