Created
December 26, 2012 18:58
-
-
Save anonymous/4382236 to your computer and use it in GitHub Desktop.
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
def set_pixel_type(type) | |
ddown_waiter = Selenium::WebDriver::Wait.new(:timeout => 3) | |
begin | |
begin | |
ddown_waiter.until{ $browser.find_element(:css, ".info") } | |
rescue | |
Sel_Utils::Sel_Utils.ClickObject("css", ".dropdown-pixel-type .button") | |
retry | |
end | |
ddown_values = $browser.find_elements(:css, ".item.clearfix .info") | |
ddown_values.each_with_index{|value, i| | |
if value.text.include?(type) | |
ddown_values[i].click | |
return | |
end | |
} | |
if($browser.find_element(:css, ".n-dropdown-input").attribute("value") != "Choose a type") | |
retry #retry from the begin block on line 4 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment