Bug 1522637 - Part 8: Allow 'element_stale' to work after process swap, r=ato

The element has never existed in the new process, so it gets a missing
error rather than a stale error in that case.

Depends on D19692

Differential Revision: https://phabricator.services.mozilla.com/D19829

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-02-15 19:49:23 +00:00
parent 848283beff
commit 42ad0f2288

View File

@ -101,7 +101,9 @@ class element_stale(object):
# Calling any method forces a staleness check
self.el.is_enabled()
return False
except errors.StaleElementException:
except (errors.StaleElementException, errors.NoSuchElementException):
# StaleElementException is raised when the element is gone, and
# NoSuchElementException is raised after a process swap.
return True