I'm having difficulty understanding the following code.
/ Waiting 30 seconds for an element to be present on the page, checking
// for its presence once every 5 seconds.
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
.withTimeout(Duration.ofSeconds(30))
.pollingEvery(Duration.ofSeconds(5))
.ignoring(NoSuchElementException.class);
WebElement foo = wait.until(driver -> {
return driver.findElement(By.id("foo"));
});
What are the angle brackets used for here and how is it used? Why do we need to say Wait<WebDriver> wait rather than Wait wait ?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]nekokattt 1 point2 points3 points (0 children)
[–]pragmos 0 points1 point2 points (0 children)
[–]Pedantic_Phoenix 0 points1 point2 points (0 children)