public static ClassName ( string classNameToFind ) : |
||
classNameToFind | string | The CSS class to find. |
Результат |
/// <summary> /// Gets a mechanism to find elements by their CSS class. /// </summary> /// <param name="classNameToFind">The CSS class to find.</param> /// <returns>A <see cref="OpenQA.Selenium.By"/> object the driver can use to find the elements.</returns> public static new SeleniumBy ClassName(string classNameToFind) => SeleniumBy.ClassName(classNameToFind);
public void FindingMultipleElementsByInvalidClassNameShouldThrow() { driver.Url = xhtmlTestPage; Assert.Throws(Is.InstanceOf <NoSuchElementException>(), () => { driver.FindElements(By.ClassName("!@#$%^&*")); }); }
public void FindingASingleElementByEmptyClassNameShouldThrow() { driver.Url = xhtmlTestPage; Assert.Throws(Is.InstanceOf <NoSuchElementException>(), () => { driver.FindElement(By.ClassName("")); }); }
public void FindingMultipleElementsByCompoundClassNameShouldThrow() { driver.Url = xhtmlTestPage; Assert.Throws <InvalidSelectorException>(() => driver.FindElements(By.ClassName("a b"))); }
public void ShouldNotFindElementByClassWhenTheNameQueriedIsShorterThanCandidateName() { driver.Url = xhtmlTestPage; Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.ClassName("nameB"))); }