How to resolve ElementNotInteractableException: Element is not visible in Selenium webdriver?

前端 未结 5 1345
春和景丽
春和景丽 2020-11-21 13:53

Here I have the image of my code and the image of my error. Can anyone help me to resolve this issue?

5条回答
  •  走了就别回头了
    2020-11-21 14:13

    Actually the Exception is Element Not Visible

    The best practice is to use Implicit wait below driver Instantiation so it get sufficient time to find element throughout the exception

    driver.get("http://www.testsite.com");
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 
    

    Still facing issue as some element require more time. Use ExplicitWait for individual element to satisfy certain condition

    In your case you are facing element not visible exception then use wait condition in following way-

    WebDriverWait wait = new WebDriverWait(driver, 120);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.your_Elemetnt));
    

提交回复
热议问题