0

Element shapshot:

enter image description here

As it can be seen from the image I can locate the element but it does not click on it. Do you think it needs explicit wait or something else? Thank you!

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

To click on the element with text as Not Now you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies:

  • Using cssSelector:

    new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.cssSelector("section +div>button"))).click();
    
  • Using xpath:

    new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//button[text()='Not Now']"))).click();
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352