Category : selenium

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