July 2019
Intermediate to advanced
536 pages
12h 57m
English
As the name suggests, the By.linkText locating mechanism can only be used to identify the HTML links. Before we start discussing how WebDriver can be commanded to identify a link element using link text, let's see what an HTML link element looks like. The HTML link elements are represented on a web page using the <a> tag, an abbreviation for the anchor tag. A typical anchor tag looks like this:
<a href="http://demo-store.seleniumacademy.com/customer/account/" title="My Account">My Account</a>
Here, href is the link to a different page where your web browser will take you when you click on the link. So, the preceding HTML code when rendered by the browser looks like this:
This MY ACCOUNT is the link text. So the ...
Read now
Unlock full access