Locates elements by a CSS selector. In Avalonia context, this maps to StyleClass/Classes matching. This is the standard Selenium-compatible method name.
public static By CssSelector(string cssSelector)
The CSS selector (class name in Avalonia).
var element = driver.FindElement(By.CssSelector(".primary"));
// Also works without the dot:
var element2 = driver.FindElement(By.CssSelector("primary"));
NOTE: Only class selectors (.className) are supported. Complex CSS selectors like "div > button" or "input[type='text']" are not supported. For complex queries, use XPath(String) instead.