Better avoiding of stale element exception
This commit is contained in:
@@ -114,16 +114,20 @@ def revert_setting_entry(label):
|
|||||||
|
|
||||||
@world.absorb
|
@world.absorb
|
||||||
def get_setting_entry(label):
|
def get_setting_entry(label):
|
||||||
settings = world.browser.find_by_css('.wrapper-comp-setting')
|
def get_setting():
|
||||||
for setting in settings:
|
settings = world.browser.find_by_css('.wrapper-comp-setting')
|
||||||
if world.css_value('.wrapper-comp-setting .setting-label') == label:
|
for setting in settings:
|
||||||
return setting
|
if setting.find_by_css('.setting-label')[0].value == label:
|
||||||
return None
|
return setting
|
||||||
|
return None
|
||||||
|
return world.retry_on_exception(get_setting)
|
||||||
|
|
||||||
@world.absorb
|
@world.absorb
|
||||||
def get_setting_entry_index(label):
|
def get_setting_entry_index(label):
|
||||||
settings = world.browser.find_by_css('.wrapper-comp-setting')
|
def get_index():
|
||||||
for index, setting in enumerate(settings):
|
settings = world.browser.find_by_css('.wrapper-comp-setting')
|
||||||
if world.css_value('.wrapper-comp-setting .setting-label') == label:
|
for index, setting in enumerate(settings):
|
||||||
return index
|
if setting.find_by_css('.setting-label')[0].value == label:
|
||||||
return None
|
return index
|
||||||
|
return None
|
||||||
|
return world.retry_on_exception(get_index)
|
||||||
|
|||||||
Reference in New Issue
Block a user