IWebDriverExtensionsFindElementsByRegEx(IWebDriver, By, Regex) Method
Finds a list of elements using the given mechanism that match the text supplied using RegEx.
Namespace: DevCase.ThirdParty.Selenium.Extensions.IWebDriverExtensionsAssembly: DevCase.net48.ThirdParty.Selenium (in DevCase.net48.ThirdParty.Selenium.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static ReadOnlyCollection<IWebElement> FindElementsByRegEx(
this IWebDriver drv,
By by,
Regex regEx
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function FindElementsByRegEx (
drv As IWebDriver,
by As By,
regEx As Regex
) As ReadOnlyCollection(Of IWebElement)
Dim drv As IWebDriver
Dim by As By
Dim regEx As Regex
Dim returnValue As ReadOnlyCollection(Of IWebElement)
returnValue = drv.FindElementsByRegEx(by,
regEx)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static ReadOnlyCollection<IWebElement^>^ FindElementsByRegEx(
IWebDriver^ drv,
By^ by,
Regex^ regEx
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member FindElementsByRegEx :
drv : IWebDriver *
by : By *
regEx : Regex -> ReadOnlyCollection<IWebElement>
No code example is currently available or this language may not be supported.
- drv IWebDriver
-
The source IWebDriver.
- by By
-
The locating mechanism to use to find the element.
- regEx Regex
-
The Regular Expression used to match the element text.
ReadOnlyCollectionIWebElementReadOnlyCollectionT of Elements that match the object so that you can interact that object.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IWebDriver. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
No code example is currently available or this language may not be supported.
Using svc As FirefoxDriverService = FirefoxDriverService.CreateDefaultService(),
drv As New FirefoxDriver(svc)
drv.Navigate().GoToUrl("https://www.domain.com/")
Dim regEx As New Regex("pattern", RegexOptions.IgnoreCase)
Dim elements As ReadOnlyCollection(Of IWebElement) =
drv.FindElementsByRegEx(By.ClassName("Button"), regEx)
For Each element As IWebElement In elements
Console.WriteLine($"({element.Location.ToString()}) '{element.TagName}' Text: {element.Text}")
Loop
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.