Created
June 3, 2013 14:21
-
-
Save tourdedave/5698489 to your computer and use it in GitHub Desktop.
A Selenium WebDriver example of how to access elements within a nested frame.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
require 'rspec-expectations' | |
def setup | |
@driver = Selenium::WebDriver.for :firefox | |
end | |
def teardown | |
@driver.quit | |
end | |
def run | |
setup | |
yield | |
teardown | |
end | |
run { | |
@driver.get 'http://the-internet.herokuapp.com/frames' | |
@driver.switch_to.frame('frame-top') | |
@driver.switch_to.frame('frame-middle') | |
@driver.find_element(id: 'content').text.should =~ /MIDDLE/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment