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

Method TagName

dotnet/src/webdriver/By.cs:286–297  ·  view source on GitHub ↗

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

(string tagNameToFind)

Source from the content-addressed store, hash-verified

284 /// <returns>A <see cref="By"/> object the driver can use to find the elements.</returns>
285 /// <exception cref="ArgumentNullException">If <paramref name="tagNameToFind"/> is null.</exception>
286 public static By TagName(string tagNameToFind)
287 {
288 if (tagNameToFind == null)
289 {
290 throw new ArgumentNullException(nameof(tagNameToFind), "Cannot find elements when name tag name is null.");
291 }
292
293 return new By(TagNameMechanism, tagNameToFind)
294 {
295 Description = "By.TagName: " + tagNameToFind
296 };
297 }
298
299 /// <summary>
300 /// Gets a mechanism to find elements by their cascading style sheet (CSS) selector.

Calls

no outgoing calls