selenium.common.exceptions.TimeoutException error using WebDriverWait with expected_conditions through Selenium and Python

This error message… Traceback (most recent call last): File “Inventorytest.py”, line 88, in <module> j.go_to_application() File “Inventorytest.py”, line 65, in go_to_application EC.element_to_be_clickable((By.ID, ‘FavoriteApp_ITEM’)) File “/home/naroladev/Mercury_Back-End/mercuryenv/lib/python3.6/site-packages/selenium/webdriver/support/wait.py”, line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: …implies that the WebDriver variant was unable to locate the desired WebElement within the timeframe for which the WebDriverWait was … Read more

Can not click on a Element: ElementClickInterceptedException in Splinter / Selenium

You can try the below 2 methods to click on element. element = driver.find_element_by_css(‘div[class*=”loadingWhiteBox”]’) driver.execute_script(“arguments[0].click();”, element) element = driver.find_element_by_css(‘div[class*=”loadingWhiteBox”]’) webdriver.ActionChains(driver).move_to_element(element ).click(element ).perform() hope this will work.

Selenium: How selenium identifies elements visible or not? Is is possible that it is loaded in DOM but not rendered on UI?

Selenium can identify the presence or visibility of the elements as soon as they are present or visible in the HTML DOM. From user perspective you can invoke isDisplayed() method on an WebElement to examine if the intended WebElement is displayed or not. As per current implementation Selenium may not be distinguishing between loaded and … Read more

How do you use EC.presence_of_element_located((By.ID, “myDynamicElement”)) except to specify class not ID

The relevant HTML would have helped us to construct a more canonical answer. However to start with your first line of code: element = WebDriverWait(driver,100).until(EC.presence_of_element_located( (By.ID, “tabla_evolucion”))) is pretty much legitimate where as the second line of code: element = WebDriverWait(driver,100).until(EC.presence_of_element_located( (By.class, “ng-binding ng-scope”))) Will raise an error as: Message: invalid selector: Compound class names … Read more

WebDriverWait not working as expected

Once you wait for the element and moving forward as you are trying to invoke click() method instead of using presence_of_element_located() method you need to use element_to_be_clickable() as follows : try: myElem = WebDriverWait(self.browser, delay).until(EC.element_to_be_clickable((By.XPATH , xpath))) Update As per your counter question in the comments here are the details of the three methods : … Read more

Selenium – wait until element is present, visible and interactable

As per the best practices: If your usecase is to validate the presence of any element you need to induce WebDriverWait setting the expected_conditions as presence_of_element_located() which is the expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible. So the … Read more