Issues with Selenium explicit wait feature in latest version of SafariDriver 2.48.0

Issues with explicit waits in my code are arising specifically when using SafariDriver 2.48.0. The waits function properly in Chrome on both Windows and MAC platforms, but in Safari, upon reaching the wait condition, the driver throws an exception.

Upon examining the error message:

Error message details go here...

The relevant portion of my code is as follows:

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()

Key Configuration information:

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

Answer №1

When using Safari, Xpath may not be the best choice. Instead, consider using CSS_SELECTOR, ID, or CLASS_NAME to troubleshoot any issues you encounter.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Subprocess.Popen is not recognizing double quotes in Python when running WinSCP scripts

I am trying to utilize the code found at to transfer files to a server using WinSCP from Python on a Windows 10 system. The code provided is as follows: import subprocess path = r'C:\mp4s\Sci-Fi Light Flicker.mp4' process = subprocess ...

Substituting a particular element within a string upon its occurrence multiple times using Python

Consider the following scenario: str1='restart' I am looking to replace the second occurrence of 'r' with '#' in the string using the replace() function, while keeping the first occurrence intact. The expected result should ...

Steps on moving slider to specific position:

On this particular page, I am required to swipe a slider to view specific quotes from different companies such as Eversave, Simplymap, and Pattern publishing. You can access the page through this link: Below is the code snippet that I currently have: pac ...

Tips on saving soup to .html with Beautiful Soup

I am currently extracting content from a website link and I am looking to save the entire webpage as an .html file locally. Is there a way for me to directly output the soup to an html file so that I can then upload a copy to S3-AWS? from bs4 import Beaut ...

Issue with ElementReference: The element cannot be located in the cache - it is possible that the page has been modified since the last lookup

I am facing an issue with my code. The code is supposed to retrieve elements set via xpath and then generate a list of strings containing the texts of each element in the set. However, I keep encountering an exception while trying to add each element' ...

In Python utilizing Selenium, it is impossible to click on the href with the value of "javascript:void(0);"

Every time I attempt to scrape information from the Eastleigh website, the process seems to work fine until it fails to navigate to the href links. Why is this happening when all it needs to do is click on the href links? Is there anyone who can assist in ...

Error message: Django error - 'post' attribute missing in object

I'm encountering an issue while attempting to perform an Ajax POST request in Django. Strangely, the view for my Ajax GET request is working perfectly fine. Here's a snippet of my code: class ChangeWordStatus(JSONResponseMixin, AjaxResponseMixin ...

Ways to transfer various data values from an Excel sheet to a single step in a Cucumber scenario

Trying to utilize the step "@when user enters the field value as 'something'" for 10 Scenarios, with each test case needing different values. However, steps cannot be repeated in the step definition. I have a utility using an Excel hashmap that ...

A situation occurred with Selenium where the element's reference became outdated during an explicit wait

When writing my Selenium test code, I encountered issues with element reference exceptions. The specific lines causing problems are: Clicking a check box Selecting an item from a drop-down menu Submitting a form by clicking a button Below is the snippet ...

TensorFlow V2 - the art of assigning variables

I am updating my code to use Tensorflow v2 and encountering the following issue: AssertionError: A function is trying to access variables that have been deleted. It seems like function-local variables were created but not used elsewhere in the program. T ...

How can we effectively incorporate an SCPI command tree structure into Python class methods for optimal implementation?

SCPI commands consist of mnemonics strung together to communicate with an instrument, adjusting settings and retrieving data. I want to create a string such as: "SENSe:VOLTage:DC:RANGe 10 V" This could be achieved through code like: inst.sense.voltage.dc ...

Exploring the Various Routes Within a Single-Source, Multi-Terminal (Potentially Cyclical) Directed Graph

I am dealing with a graph structure G = (V,E), where V is a subset of {0, 1, 2, 3, …} E is a subset of VxV The graph does not have any disconnected components Cycles are allowed in the graph There is a specified node v in V as the source; meaning th ...

Checking for unclickability of an element in Selenide

Looking to confirm that an element cannot be clicked or is not clickable using Selenide ...

Encountering a problem when trying to execute a function in Datab

I encountered an issue when calling a currency conversion function I created in Databricks. The error message is as follows: I attempted to resolve the problem with the following code snippet from pyspark.sql.functions import lit from pyspark.sql.function ...

Exploring the Contrast Between "Wait until Visible" and "Wait until Located" Commands in Selenium

When utilizing both wait(until.elementLocated(element, timeout)) and wait(until.elementVisible(element, timeout)), I have noticed that the 'wait until visible' method fails in certain scenarios where the 'wait until located' method does ...

Creating a JSON schema in JSL python library that defines a mapping of strings to strings

Imagine a scenario where my JSON document contains various properties, one of which holds a collection of HTTP headers represented as a simple map of key-value pairs. { "property": "value", "headers": { "Content-Type": "text/css", "Last-Modifi ...

Transforming a class instance into a JSON format

I'm encountering an issue trying to convert a class instance into a JSON string. Let's consider the structure of the class: class testclass: value1 = "a" value2 = "b" The json.dumps method is being used like this: t = testclass() json. ...

My method for resolving the recurrence error in identifying the FindMaximumSubarray through a divide and conquer strategy

I attempted to solve the findMaximumSubarray using the CLRS Pseudo code algorithm, but encountered a recursion error that I couldn't figure out. It's this part of the recursion process that has me stumped - dividing the left array until reaching ...

What steps should I take in order to resolve the java.lang.NoClassDefFoundError exception?

I'm having issues with the Extent reporting API where I keep encountering the same exception every time I try to execute the code: [RemoteTestNG] detected TestNG version 7.4.0 FAILED CONFIGURATION: @BeforeTest startReport java.lang.NoClassDefFoundErro ...

Changing permission based on request.query_params within Django Rest Framework – a comprehensive guide

I combined two perspectives that are nearly identical except for the permissions. I aim to adjust permissions based on whether the company ID is in the parameters. If not, it will default to using a basic IsAuthenticated class and also introduced a permi ...