0

Explicit waits in my codes are not working in SafariDriver 2.48.0. it's working in chrome in windows and MAC. when wait is reached it's driver throwing exception

File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/support/wait.py", line 71, in until value = method(self._driver) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/support/expected_conditions.py", line 78, in call return _element_if_visible(_find_element(driver, self.locator)) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/support/expected_conditions.py", line 98, in _element_if_visible return element if element.is_displayed() == visibility else False File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webelement.py", line 358, in is_displayed return self._execute(Command.IS_ELEMENT_DISPLAYED)['value'] File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webelement.py", line 494, in _execute return self._parent.execute(command, params) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 163, in check_response raise exception_class(value)

My code is:

self.driver = webdriver.Safari() self.driver.wait = WebDriverWait(self.driver, 60) self.driver.get("http://example.com") # Click Sign in button and wait for sign in page self.driver.find_element_by_xpath(XMLDict['SignIn'].Xpath).click() self.driver.wait.until(EC.visibility_of_element_located((By.ID, XMLDict['User'].ID))) self.driver.maximize_window() 

Configuration:

OS - macOS Sierra Selenium 3.0.1 Safari - 10.0.1 SafariDriver - 2.48.0 Python 3.5 

1 Answer 1

0

Xpath doesn't work well with Safari, try to solve your problem with CSS_SELECTOR, ID, or CLASS_NAME

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.