October 2018
Intermediate to advanced
192 pages
5h 12m
English
Now that we have seen how to create relative (customized) XPaths, it's time to see how to retrieve WebElements programmatically using Java lists. The best way to understand this is through an example. Suppose we want to find all the input textboxes on the login page of http://www.freecrm.com. We will make use of the findElements method. Remember, the findElements method is in the SearchContext interface.
Since the WebDriver interface is a child interface of SearchContext, it inherits the findElements method and we can invoke this method on the reference variable of WebDriver. In conjunction with findElements, we will also make use of the static method, tagName , of the By class.
The following ...
Read now
Unlock full access