0

I am trying to interact with a calendar on a webpage, so I am using WebDriver wait.

Below is the method:

new WebDriverWait(driver,Duration.ofSeconds(5)).until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.className("calendar")));

Is something wrong here? The errors are shown as:

Multiple markers at this line
    - Duration cannot be resolved or is not a field
    - Syntax error on token ",", . expected
    - The constructor WebDriverWait(WebDriver, Duration) is 
     undefined

what is wrong here?

Vidhya
  • 79
  • 2
  • 6

1 Answers1

0

To resolve the Duration issue :

import java.time.Duration;

import this at the top, "Duration" got resolved it worked for me.

Procrastinator
  • 2,526
  • 30
  • 27
  • 36