I am working in Selenium, and this question is more specific to Java rather than Selenium.
The example I am providing is Selenium WebDriver ExplicitWait,
new ExpectedCondition<WebElement>(){
@Override
public WebElement apply(WebDriver d)
{
return d.findElement(By.id("myDynamicElement"));
}});
What he is exactly Doing ? How he is writing Logic without Assigning a Reference to an object to the class ExpectedCondition ???
Thanks.
What is happening here is the creation of an anonymous class that inherits from ExpectedCondition
. In the body of this class he is then overriding the method apply(...)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With