ByClassName Method WebDriver
Gets a mechanism to find elements by their CSS class.

Namespace: OpenQA.Selenium
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax

public static By ClassName(
	string classNameToFind
)

Parameters

classNameToFind
Type: SystemString
The CSS class to find.

Return Value

Type: By
A By object the driver can use to find the elements.
Remarks

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".
See Also

Reference