Explicit wait from parent element Python Selenium

Hi everyone,

I’ve been having some issues regarding to make the webdriverwait for an element inherited from a parent element.

I run a for loop from a element, which have at least more than 2 divs at bottom-level div like so:
tasks = driver.find_elements(By.XPATH, ‘/html/body/div[1]/div[1]/div[2]/div/div/div’)
for index in range(1, len(tasks)+1):

Then i have to find the parent element again, because in more than one of the iterations there are iframes:
task = driver.find_element(By.XPATH, f’/html/body/div[1]/div[1]/div[2]/div/div/div[{index}]’)

After that, I check if a one-level-lower div exists (this always happens) with the syntax “./” like so:
WebDriverWait(task, 10).until(ec.visibility_of_element_located((By.XPATH, ‘./div’)))

Now, this last line is where the run breaks and returns the following error:
AttributeError: ‘WebElement’ object has no attribute ‘command_executor’

This code works when webdriver and WebDriverWait are imported from selenium, but when I comment them and add webdriver and WebDriverWait from src.testproject.sdk.drivers and .classes, respectively, it just doesn’t work.

Hope you can give me a hand with this.

Hi @dieguinho ,

First of all welcome to our community.
Please follow this example on how to use the webdriverwait with the openSDK correctly:

More valuable information about pythonSDK examples you can find here:

Let me know if you have any more questions, I’d be happy to help :slight_smile: