0

public static void month(WebDriver driver)

{
    driver.findElement(By.xpath("//label[text()='Onward Date']")).click();
    while(!driver.findElement(By.className("monthTitle")).getText().contains("May"))
    {
        driver.findElement(By.cssSelector("td[class='next'] button")).click();
    }
}

CHeck the below attached image below, Have accessed the > next button through CSS selector

Please help me on this

  • The error is self explanatory - The element cannot be interacted upon. By the time you're clicking on the button, it is disabled and cannot be clicked. See if adding a couple of seconds waiting helps. – demouser123 Dec 24 '19 at 7:35
  • Questions of this nature are here almost every day. Have you searched the forum? What have you found? In general, you should learn about waits and read sqa.stackexchange.com/q/41860/41012 – pavelsaman Dec 24 '19 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.