Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'selenium-webdriver'
- browser = Selenium::WebDriver.for :firefox
- browser.get "http://localhost/page6"
- wait = Selenium::WebDriver::Wait.new(:timeout => 15)
- # Check that the radio button exists
- puts "Test Passed: Radio button found" if wait.until {
- browser.find_element(:name, "radiobutton1").displayed?
- }
- # Change the state of the Radio Buttons
- cb1 = wait.until {
- element = browser.find_element(:name, "radiobutton1")
- element if element.displayed?
- }
- cb1.click if cb1.selected? == false
- cb3 = wait.until {
- element = browser.find_element(:name, "radiobutton3")
- element if element.displayed?
- }
- cb3.click if cb3.selected? == false
- browser.quit
Advertisement
Add Comment
Please, Sign In to add comment