Gets a mechanism to find elements by their CSS class.
Namespace: OpenQA.SeleniumAssembly: WebDriver (in WebDriver.dll) Version: 2.35.0.0 (2.35.0.0)
public static By ClassName(
string classNameToFind
)
public static By ClassName(
string classNameToFind
)
Public Shared Function ClassName ( _
classNameToFind As String _
) As By
Public Shared Function ClassName ( _
classNameToFind As String _
) As By
public:
static By^ ClassName(
String^ classNameToFind
)
public:
static By^ ClassName(
String^ classNameToFind
)
Parameters
- classNameToFind
- Type:
System String
The CSS class to find.
Return Value
A
By object the driver can use to find the elements.
If an element has many classes then this will match against each of them.
For example if the value is "one two onone", then the following values for the
className parameter will match: "one" and "two".