ie.button(:value, 'Cancel').click
///////////////////////////////////////////////////////////////////////////////////
require 'watir-webdriver'
browser = Watir::Browser.new :firefox
browser.goto "http://google.com"
browser.text_field(:name => 'q').set("WebDriver rocks!")
browser.(:name => 'btnG').click
puts browser.url
browser.close
//////////////////////////////////////////////////////////////////////////////////////////////////////
require
'watir-webdriver'
b = Watir::Browser.start
'bit.ly/watir-webdriver-demo'
b.select_list(
:id
=>
'entry_1'
).wait_until_present
b.text_field(
:id
=>
'entry_0'
).when_present.set
'your name'
b.button(
:value
=>
'Submit'
).click
b.button(
:value
=>
'Submit'
).wait_while_present
Watir::Wait.
until
{ b.text.include?
'Thank you'
}
require
'watir-webdriver'
b = Watir::Browser.
new
b.driver.manage.timeouts.implicit_wait =
3
#3 seconds
#!/usr/bin/env ruby
require 'rubygems'
require 'selenium-webdriver'
caps = Selenium::WebDriver::Remote::Capabilities.firefox
caps.version = "8"
caps.platform = :WINDOWS
driver = Selenium::WebDriver.for(
:remote,
:url => "http://API_KEY:[email protected]:4444/wd/hub",
:desired_capabilities => caps)
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit