IWebDriverExtensionsFindElementsByText(IWebDriver, By, String, StringComparison) Method
Finds a list of elements using the given mechanism that match the text supplied.
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> FindElementsByText(
this IWebDriver drv,
By by,
string text,
StringComparison stringComparison
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function FindElementsByText (
drv As IWebDriver,
by As By,
text As String,
stringComparison As StringComparison
) As ReadOnlyCollection(Of IWebElement)
Dim drv As IWebDriver
Dim by As By
Dim text As String
Dim stringComparison As StringComparison
Dim returnValue As ReadOnlyCollection(Of IWebElement)
returnValue = drv.FindElementsByText(by,
text, stringComparison)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static ReadOnlyCollection<IWebElement^>^ FindElementsByText(
IWebDriver^ drv,
By^ by,
String^ text,
StringComparison stringComparison
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member FindElementsByText :
drv : IWebDriver *
by : By *
text : string *
stringComparison : StringComparison -> 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.
- text String
-
The text to match in the element.
- stringComparison StringComparison
-
Specifies the culture, case, and sort rules to be used.
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 elements As ReadOnlyCollection(Of IWebElement) =
drv.FindElementsByText(By.ClassName("Button"), "text", StringComparison.OrdinalIgnoreCase)
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.