Created
December 10, 2012 05:59
-
-
Save p0deje/4248710 to your computer and use it in GitHub Desktop.
Selenium wrapped select
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' | |
browser = Selenium::WebDriver.for :firefox | |
browser.get 'http://www.commonfloor.com/' | |
# first open up drop down | |
browser.find_element(xpath: '//div[@id="city_chzn"]/a').click | |
# now click necessary element (note that it won't work with selenium 2.27) | |
browser.find_element(xpath: '//div[@id="city_chzn"]//li[contains(.,"Bangalore")]').click |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment