You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Issue#3, we asked for inheriting from WebElement by implementing the entire interface. An easier approach could be to leverage the instance behind the WebElement interface by using composition. In CustomWebElement constructor, we can for example maintain a WebElement reference right away. Then within implementation of methods like getAttribute(), we can do following:
public String getAttribute(String attributeName) {
return this.webElemRef.getAttribute(attributeName);
}
Instead of the existing implementation which is like follows:
public String getAttribute(String attributeName) {
return getWebDriver().findElement(getBy()).getAttribute(attributeName);
}
The text was updated successfully, but these errors were encountered:
In Issue#3, we asked for inheriting from WebElement by implementing the entire interface. An easier approach could be to leverage the instance behind the WebElement interface by using composition. In CustomWebElement constructor, we can for example maintain a WebElement reference right away. Then within implementation of methods like getAttribute(), we can do following:
Instead of the existing implementation which is like follows:
The text was updated successfully, but these errors were encountered: