Improve retry logic for Stale Element Exceptions

Better exception retry logic

Change methods to lambdas
This commit is contained in:
Jay Zoldak
2013-09-17 09:02:28 -04:00
parent cd3063f67d
commit fe71ace529
2 changed files with 49 additions and 26 deletions

View File

@@ -67,7 +67,7 @@ def get_index(name):
page_name_css = 'section[data-type="HTMLModule"]'
all_pages = world.css_find(page_name_css)
for i in range(len(all_pages)):
if all_pages[i].html == '\n {name}\n'.format(name=name):
if world.retry_on_exception(lambda: all_pages[i].html) == '\n {name}\n'.format(name=name):
return i
return None