Hello guys, I dont know why but sometimes the click() do not work
The loop, number 1,2,3 is good, and in the 4 have a error, it say:
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
He find the f[i], and looks he is bypssing the
driver.find_element_by_xpath(f[4]).click()
because the error is in
driver.wait.until(EC.presence_of_element_located((By.XPATH,"xpath4")))
and of course he eill not find the xpath4 because he dont open the element f[4].
You now why he is bypassing, or another way more efficient to open a element?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
a = 11 def my_function(i,driver): while i<a: element = driver.wait.until(EC.presence_of_element_located((By.XPATH,f[i]))) driver.find_element_by_xpath(f[i]).click() - - - >driver.wait.until(EC.presence_of_element_located((By.XPATH, "xpath4" ))) driver.find_element_by_xpath( "xpath4" ).click() import time time.sleep( 2 ) driver.back() i = i + 1 import time time.sleep( 3 ) pass pass |
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
He find the f[i], and looks he is bypssing the
driver.find_element_by_xpath(f[4]).click()
because the error is in
driver.wait.until(EC.presence_of_element_located((By.XPATH,"xpath4")))
and of course he eill not find the xpath4 because he dont open the element f[4].
You now why he is bypassing, or another way more efficient to open a element?