It's about time to discuss the other location techniques in Selenium WebDriver 3
The ones that we will be discussing are:
- ByIdOrName: This locator can be used with WebElements that have both an id and name
- ByChained: This locator can be used to find WebElements using a series of other location techniques
- ByAll: This locator finds all WebElements that match any of the locators in sequence
The best way to explain these is by giving an example for each. For this, we will be creating a custom web page in HTML:
<html>
<body>
<p>
First Name:
<input type=text id=fid/>
</p>
<p>
Last Name:
<input type=text name=lname/>
</p>
</body>
</html>
It's time to see the ByIdOrName locator.