Class ElementId
- Namespace
- CSF.Screenplay.Selenium.Elements
- Assembly
- CSF.Screenplay.Selenium.dll
Concrete implementation of Locator which locates an element by its id attribute.
public class ElementId : Locator, ITarget, IHasName
- Inheritance
-
ElementId
- Implements
- Inherited Members
- Extension Methods
Remarks
In normal circumstances (with valid HTML) this locator should match a maximum of only one element.
Constructors
ElementId(string, string)
Initializes a new instance of the ElementId class.
public ElementId(string id, string name = null)
Parameters
idstringThe id by which to locate an element.
namestringAn optional human-readable name of the locator which describes the element it matches.
Methods
GetDefaultName()
Gets a value for Name if none has been specified.
protected override string GetDefaultName()
Returns
- string
A default name
GetLocator()
Gets the Selenium locator instance for finding HTML elements.
public override By GetLocator()
Returns
- By
A Selenium
Byobject used to locate elements.