MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / LinkText

Method LinkText

dotnet/src/webdriver/By.cs:175–186  ·  view source on GitHub ↗

Gets a mechanism to find elements by their link text. The link text to find. A object the driver can use to find the elements. If is null.

(string linkTextToFind)

Source from the content-addressed store, hash-verified

173 /// <returns>A <see cref="By"/> object the driver can use to find the elements.</returns>
174 /// <exception cref="ArgumentNullException">If <paramref name="linkTextToFind"/> is null.</exception>
175 public static By LinkText(string linkTextToFind)
176 {
177 if (linkTextToFind == null)
178 {
179 throw new ArgumentNullException(nameof(linkTextToFind), "Cannot find elements when link text is null.");
180 }
181
182 return new By(LinkTextMechanism, linkTextToFind)
183 {
184 Description = "By.LinkText: " + linkTextToFind
185 };
186 }
187
188 /// <summary>
189 /// Gets a mechanism to find elements by their name.

Calls

no outgoing calls