Wait for an element using Selenium webdriver

后端 未结 4 700
耶瑟儿~
耶瑟儿~ 2021-01-23 07:11

What is the best way to wait for an element to appear on a web page? I have read that we can use implicit wait and functions like webdriverwait, fluentwait etc and last but not

4条回答
  •  Happy的楠姐
    2021-01-23 07:37

    WebDriverWait wait = new WebDriverWait(driver, 20);
    wait.until(ExpectedConditions.elementToBeClickable(By.id("optionsBuilderSelect_input")));
    

    I'm a professional scraper (http://nitinsurana.com) I've written 30+ softwares using selenium and I've never faced any such issue, anyways above is a sample code.

    All I can think of is that what until condition has to be checked because many a times elements are already visible, but they are not clickable and things like that. I guess you should give different options a try and I hope you'll find the one required.

提交回复
热议问题