Skip to content

Commit

Permalink
Adding UnexpectedAlertPresentException to python bindings
Browse files Browse the repository at this point in the history
Signed-off-by: AutomatedTester <dburns@mozilla.com>
  • Loading branch information
jhillacre authored and AutomatedTester committed Mar 22, 2013
1 parent 81c74f7 commit 4ece983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/selenium/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class StaleElementReferenceException(WebDriverException):
class InvalidElementStateException(WebDriverException):
pass

class UnexpectedAlertPresentException(WebDriverException):
pass

class NoAlertPresentException(WebDriverException):
pass

Expand Down
3 changes: 3 additions & 0 deletions py/selenium/webdriver/remote/errorhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from selenium.common.exceptions import NoSuchWindowException
from selenium.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import UnableToSetCookieException
from selenium.common.exceptions import UnexpectedAlertPresentException
from selenium.common.exceptions import NoAlertPresentException
from selenium.common.exceptions import ErrorInResponseException
from selenium.common.exceptions import TimeoutException
Expand Down Expand Up @@ -110,6 +111,8 @@ def check_response(self, response):
exception_class = TimeoutException
elif status == ErrorCode.UNKNOWN_ERROR:
exception_class = WebDriverException
elif status == ErrorCode.UNEXPECTED_ALERT_OPEN:
exception_class = UnexpectedAlertPresentException
elif status == ErrorCode.NO_ALERT_OPEN:
exception_class = NoAlertPresentException
elif status == ErrorCode.IME_NOT_AVAILABLE:
Expand Down

0 comments on commit 4ece983

Please sign in to comment.