Category : selenium-webdriver

from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By driver = webdriver.Firefox() driver.get(‘https://pythonbasics.org’) timeout = 3 try: element_present = EC.presence_of_element_located((By.ID, ‘main’)) WebDriverWait(driver, timeout).until(element_present) except TimeoutException: print("Timed out waiting for page to load") finally: print("Page loaded") This is my code , i want ..

Read more

driver.get("https://test.com/#/") delay = 9 # seconds try: start_time = time.time() myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.XPATH, ‘/html/body/app-root/div[1]/div[1]/div[3]/div[2]/div[1]/div/app-home/div/div[1]’))) x = ("%s" % (time.time() – start_time)) roundE =float(x) roundEs = math.ceil(roundE) print(roundEs) I want to get Xpath loaded time , is it correctly ? Source: Python-3x..

Read more

I am trying to click on the ‘Cancel’ button in the Print Preview Application in Chrome. I have tried several solutions but finally landed on this question which has been of great help https://stackoverflow.com/questions/56380091/how-to-interact-with-the-elements-within-shadow-root-open-while-clearing-brow/56381495#56381495. I have followed the steps to do the same to Cancel the Print Preview Application button but I keep receiving: Message: ..

Read more