Class FindElementBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
A builder class for finding a single element within a specified target.
public class FindElementBuilder : IGetsPerformableWithResult<SeleniumElement>
- Inheritance
-
FindElementBuilder
- Implements
- Inherited Members
Remarks
This builder offers two methods to configure the finding of elements:
- WhichMatches(Locator) - Specify a Locator which should be used to filter for the element.
- AndNameIt(string) - Specify a human-readable name for the element which is found.
Constructors
FindElementBuilder(ITarget)
Initializes a new instance of the FindElementsBuilder class with the specified target.
public FindElementBuilder(ITarget target)
Parameters
targetITargetThe target within which elements will be found.
Methods
AndNameIt(string)
Specifies a human-readable name for the collection of elements which are found.
public FindElementBuilder AndNameIt(string name)
Parameters
namestringThe name for the collection of elements.
Returns
- FindElementBuilder
The current instance of FindElementsBuilder.
WhichMatches(Locator)
Specifies a Locator which should be used to filter the elements which are found.
public FindElementBuilder WhichMatches(Locator locator)
Parameters
locatorLocatorThe locator to filter the elements.
Returns
- FindElementBuilder
The current instance of FindElementsBuilder.
Operators
implicit operator SingleElementPerformableWithResultAdapter<SeleniumElement>(FindElementBuilder)
Converts a FindElementsBuilder to a SingleElementPerformableWithResultAdapter<TResult>.
public static implicit operator SingleElementPerformableWithResultAdapter<SeleniumElement>(FindElementBuilder builder)
Parameters
builderFindElementBuilderThe FindElementBuilder instance to convert.