public static Name ( string nameToFind ) : |
||
nameToFind | string | The name to find. |
Résultat |
/// <summary> /// Gets a mechanism to find elements by their name. /// </summary> /// <param name="nameToFind">The name to find.</param> /// <returns>A <see cref="OpenQA.Selenium.By"/> object the driver can use to find the elements.</returns> public static new SeleniumBy Name(string nameToFind) => SeleniumBy.Name(nameToFind);
public void ShouldBeAbleToSwitchToAFrameByItsID() { driver.Url = framesetPage; driver.SwitchTo().Frame("fifth"); Assert.AreEqual("Open new window", driver.FindElement(By.Name("windowOne")).Text); }
public void ShouldBeAbleToSwitchToAnIframeByItsID() { driver.Url = iframePage; driver.SwitchTo().Frame("iframe1"); Assert.AreEqual("name", driver.FindElement(By.Name("id-name1")).GetAttribute("value")); }
public void FindingASingleElementByNameWithSpaceShouldThrow() { driver.Url = formsPage; Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name("nonexistent button"))); }
public void FindingASingleElementByEmptyNameShouldThrow() { driver.Url = formsPage; Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name(""))); }
public void ShouldNotBeAbleToLocateByNameASingleElementThatDoesNotExist() { driver.Url = formsPage; Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name("nonExistentButton"))); }
public void ShouldNotBeAbleToSubmitAFormThatDoesNotExist() { driver.Url = formsPage; driver.FindElement(By.Name("there is no spoon")).Submit(); }
public void ShouldNotBeAbleToSubmitAFormThatDoesNotExist() { driver.Url = formsPage; driver.FindElement(By.Name("SearchableText")).Submit(); }