Selenium Webdriver stuck when find_element method called with a non-existed widget

前端 未结 2 567
醉梦人生
醉梦人生 2020-12-21 18:53

I\'m trying to test with selenium webdriver. My version of selenium is 2.33 and the browser is Firefox. The scripting language is python

Now when I call the method <

2条回答
  •  别那么骄傲
    2020-12-21 19:20

    You can use WebDriverWait function if you are sure that the element is on your document. You should define WebDriverWait at the beginning with from selenium.webdriver.support.ui import WebDriverWait and if you didn't define before from selenium.webdriver.common.by import By, then use WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, "blabla"))) That's all we need to do. I hope this will help you.

提交回复
热议问题