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/page10"
- wait = Selenium::WebDriver::Wait.new(:timeout => 15)
- # Switch to the 1st frame
- browser.switch_to.frame("frame1")
- # Find text in the 1st frame by regexp
- puts "Test Passed: Frame 1 Validated" if wait.until {
- /An operating system is the set of basic programs and utilities that make
- your computer run/.match(browser.page_source)
- }
- # Switch to parent page
- browser.switch_to.default_content
- # Switch to the 2nd frame
- browser.switch_to.frame("frame2")
- # Find text in the 2nd frame by regexp
- puts "Test Passed: Frame 2 Validated" if wait.until {
- /Welcome to the Linux Kernel Archives/.match(browser.page_source)
- }
- # Switch to parent page
- browser.switch_to.default_content
- # Switch to the 3rd frame
- browser.switch_to.frame("frame3")
- # Find text in the 3rd frame by regexp
- puts "Test Passed: Frame 3 Validated" if wait.until {
- /Ubuntu is, and always will be, absolutely free/.match(browser.page_source)
- }
- browser.quit
Advertisement
Add Comment
Please, Sign In to add comment