Class ByAll
Defines a
Inheritance
Namespace: Legerity
Assembly: Legerity.Core.dll
Syntax
public class ByAll : By
Remarks
The order of the locators is run in sequence which means that results of FindElements(ISearchContext) may not be in order of their location on screen.
Examples
The following example shows how to find all elements that match the class name and then the text. All locators must match for the element to be returned.
driver.FindElement(new ByAll(By.ClassName("my-class"), By.Text("My Text")));
Constructors
| Improve this Doc View SourceByAll(By[])
Initializes a new instance of the ByAll class.
Declaration
public ByAll(params By[] locators)
Parameters
Type | Name | Description |
---|---|---|
By[] | locators | The locators to find all references of. |
Methods
| Improve this Doc View SourceFindElement(ISearchContext)
Finds the first element matching the criteria.
Declaration
public override IWebElement FindElement(ISearchContext context)
Parameters
Type | Name | Description |
---|---|---|
ISearchContext | context | An OpenQA.Selenium.ISearchContext object to use to search for the elements. |
Returns
Type | Description |
---|---|
IWebElement | The first matching OpenQA.Selenium.IWebElement on the current context. |
FindElements(ISearchContext)
Finds all elements matching the criteria.
Declaration
public override ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
Parameters
Type | Name | Description |
---|---|---|
ISearchContext | context | An OpenQA.Selenium.ISearchContext object to use to search for the elements. |
Returns
Type | Description |
---|---|
ReadOnlyCollection<IWebElement> | A System.Collections.ObjectModel.ReadOnlyCollection`1 of all OpenQA.Selenium.IWebElement matching the current criteria, or an empty list if nothing matches. |