Class SeleniumElementCollection
- Namespace
- CSF.Screenplay.Selenium.Elements
- Assembly
- CSF.Screenplay.Selenium.dll
An implementation of ITarget which represents a collection of native Selenium HTML elements.
public class SeleniumElementCollection : ITarget, IHasName, IReadOnlyList<SeleniumElement>, IReadOnlyCollection<SeleniumElement>, IEnumerable<SeleniumElement>, IEnumerable
- Inheritance
-
SeleniumElementCollection
- Implements
- Inherited Members
- Extension Methods
Remarks
It is perfectly acceptable for this collection to contain only a single element, or even to contain zero elements.
Constructors
SeleniumElementCollection(IReadOnlyCollection<IWebElement>, string)
Initializes a new instance of the SeleniumElementCollection class.
public SeleniumElementCollection(IReadOnlyCollection<IWebElement> elements, string name = null)
Parameters
elementsIReadOnlyCollection<IWebElement>A collection of native Selenium elements.
namestringAn optional human-readable name which describes the collection of elements.
SeleniumElementCollection(IReadOnlyList<SeleniumElement>, string)
Initializes a new instance of the SeleniumElementCollection class.
public SeleniumElementCollection(IReadOnlyList<SeleniumElement> elements, string name = null)
Parameters
elementsIReadOnlyList<SeleniumElement>The list of elements.
namestringAn optional human-readable name which describes the collection of elements.
Properties
Count
public int Count { get; }
Property Value
this[int]
public SeleniumElement this[int index] { get; }
Parameters
indexint
Property Value
Name
Gets the human-readable name of the current object.
public string Name { get; }
Property Value
Remarks
null is strongly discouraged here. All types which implement IHasName should return a non-null response from this property.
Methods
GetEnumerator()
public IEnumerator<SeleniumElement> GetEnumerator()
Returns
ToString()
public override string ToString()