Class ByIdOrName

java.lang.Object
org.openqa.selenium.By
org.openqa.selenium.support.ByIdOrName
All Implemented Interfaces:
Serializable

public class ByIdOrName extends By implements Serializable
See Also:
  • Constructor Details

    • ByIdOrName

      public ByIdOrName(String idOrName)
  • Method Details

    • findElement

      public WebElement findElement(SearchContext context)
      Description copied from class: By
      Find a single element. Override this method if necessary.
      Overrides:
      findElement in class By
      Parameters:
      context - A context to use to find the element.
      Returns:
      The WebElement that matches the selector.
    • findElements

      public List<WebElement> findElements(SearchContext context)
      Description copied from class: By
      Find many elements.
      Specified by:
      findElements in class By
      Parameters:
      context - A context to use to find the elements.
      Returns:
      A list of WebElements matching the selector.
    • toString

      public String toString()
      Overrides:
      toString in class By