Commit e84fa638 by Jay Zoldak

Catch WebDriverException

parent 21c15d8f
...@@ -97,10 +97,14 @@ def assert_css_with_text(css, text): ...@@ -97,10 +97,14 @@ def assert_css_with_text(css, text):
def css_click(css): def css_click(css):
''' '''
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> Catch WebDriverException
First try to use the regular click method, First try to use the regular click method,
but if clicking in the middle of an element but if clicking in the middle of an element
doesn't work it might be that it thinks some other doesn't work it might be that it thinks some other
element is on top of it there so click in the upper left element is on top of it there so click in the upper left
<<<<<<< HEAD
''' '''
try: try:
assert_true(world.browser.is_element_present_by_css(css, 5)) assert_true(world.browser.is_element_present_by_css(css, 5))
...@@ -113,6 +117,14 @@ def css_click(css): ...@@ -113,6 +117,14 @@ def css_click(css):
''' '''
css_click_at(css) css_click_at(css)
>>>>>>> Click in the upper left of an element instead of the middle. >>>>>>> Click in the upper left of an element instead of the middle.
=======
'''
try:
assert_true(world.browser.is_element_present_by_css(css, 5))
world.browser.find_by_css(css).first.click()
except WebDriverException, e:
css_click_at(css)
>>>>>>> Catch WebDriverException
def css_click_at(css, x=10, y=10): def css_click_at(css, x=10, y=10):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment