Name() 공개 정적인 메소드

Gets a mechanism to find elements by their name.
public static Name ( string nameToFind ) : By
nameToFind string The name to find.
리턴 By
 /// <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);
예제 #2
0
 public void ShouldBeAbleToSwitchToAFrameByItsID()
 {
     driver.Url = framesetPage;
     driver.SwitchTo().Frame("fifth");
     Assert.AreEqual("Open new window", driver.FindElement(By.Name("windowOne")).Text);
 }
예제 #3
0
 public void ShouldBeAbleToSwitchToAnIframeByItsID()
 {
     driver.Url = iframePage;
     driver.SwitchTo().Frame("iframe1");
     Assert.AreEqual("name", driver.FindElement(By.Name("id-name1")).GetAttribute("value"));
 }
예제 #4
0
 public void FindingASingleElementByNameWithSpaceShouldThrow()
 {
     driver.Url = formsPage;
     Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name("nonexistent button")));
 }
예제 #5
0
 public void FindingASingleElementByEmptyNameShouldThrow()
 {
     driver.Url = formsPage;
     Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name("")));
 }
예제 #6
0
 public void ShouldNotBeAbleToLocateByNameASingleElementThatDoesNotExist()
 {
     driver.Url = formsPage;
     Assert.Throws <NoSuchElementException>(() => driver.FindElement(By.Name("nonExistentButton")));
 }
예제 #7
0
 public void ShouldNotBeAbleToSubmitAFormThatDoesNotExist()
 {
     driver.Url = formsPage;
     driver.FindElement(By.Name("there is no spoon")).Submit();
 }
예제 #8
0
 public void ShouldNotBeAbleToSubmitAFormThatDoesNotExist()
 {
     driver.Url = formsPage;
     driver.FindElement(By.Name("SearchableText")).Submit();
 }