Selenium exception: element not intractable



  • enter image description here

        WebDriverWait wait = new WebDriverWait(driver, 30); 
        WebElement button = wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("(//div[contains(@class,'RadioButton_radioButton__12O81')]//label[contains(@for,'2')])"))));
        button.click();
    

    Radio button selection...



  • The problem is probably on this Thread.sleep. You could add an explicit wait for the element before clicking.

    WebDriverWait wait = new WebDriverWait(driver, timeout); 
    WebElement button = wait.until(ExpectedConditions.elementToBeClickable(locator));
    button.click();
    

    It will check constantly the state of the element and continue to the click as soon as it is clickable (for timeout seconds maximum).



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2