From 32f11ff7fd7841b123f157720dcc95740f156ca8 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Thu, 31 Jan 2019 11:46:56 -0500 Subject: [PATCH] Use 'switch_to.alert' instead of deprecated 'switch_to_alert' (#675) ``` === warnings summary ===================================================== .../splinter/driver/webdriver/__init__.py:305: DeprecationWarning: use driver.switch_to.alert instead return AlertElement(self.driver.switch_to_alert()) ======================================================================= ``` See the docs: https://selenium-python.readthedocs.io/api.html?highlight=switch_to#selenium.webdriver.remote.webdriver.WebDriver.switch_to_alert --- splinter/driver/webdriver/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splinter/driver/webdriver/__init__.py b/splinter/driver/webdriver/__init__.py index 29df52ed7..a36910e2e 100644 --- a/splinter/driver/webdriver/__init__.py +++ b/splinter/driver/webdriver/__init__.py @@ -302,7 +302,7 @@ def is_element_not_present_by_id(self, id, wait_time=None): return self.is_element_not_present(self.find_by_id, id, wait_time) def get_alert(self): - return AlertElement(self.driver.switch_to_alert()) + return AlertElement(self.driver.switch_to.alert()) def is_text_present(self, text, wait_time=None): wait_time = wait_time or self.wait_time