Skip to content

Instantly share code, notes, and snippets.

@llaskin
Forked from anonymous/gist:4382236
Last active December 10, 2015 04:38
Show Gist options
  • Save llaskin/4382305 to your computer and use it in GitHub Desktop.
Save llaskin/4382305 to your computer and use it in GitHub Desktop.
catch :choosetype do
p "restarting"
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
break
end
}
sleep 1
if($browser.find_element(:css, ".n-dropdown-input").attribute("value") == "Choose a type")
p "throwing"
throw :choosetype
else
p "not throwing"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment