Package org.openqa.selenium

Examples of org.openqa.selenium.By


  private String partial = "first climbed on 29 May 1953";


  @Test
  public void testCanFindByName() {
    By b = By.name(english);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("name"), english);
  }
View Full Code Here


    Assert.assertEquals(element.getAttribute("name"), english);
  }

  @Test
  public void testCanFindByLabel() {
    By b = By.linkText("label=" + english);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("label"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("label"), english);
  }

  @Test
  public void testCanFindByValue() {
    By b = By.linkText("value=" + english);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("value"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("value"), english);
  }

  @Test
  public void testCanFindByPartialName() {
    By b = By.partialLinkText("name=" + partial);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("name"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("name"), english);
  }

  @Test
  public void testCanFindByRegexName() {
    By b = By.partialLinkText("name=first climbed on (.*) and has a height");
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("name"), english);
  }
View Full Code Here

  }


  @Test
  public void testCanFindByPartialLabel() {
    By b = By.partialLinkText("label=" + partial);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("label"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("label"), english);
  }

  @Test
  public void testCanFindByPartialValue() {
    By b = By.partialLinkText("value=" + partial);
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("value"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("value"), english);
  }

  @Test
  public void testCannotFindById() {
    By b = By.id(english);
    driver.findElement(b);
  }
View Full Code Here

    driver.findElement(b);
  }

  @Test
  public void testCanFindByNamel10n() {
    By b = By.partialLinkText("name=l10n('sentenceFormat')");
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("name"), english);
  }
View Full Code Here

    Assert.assertEquals(element.getAttribute("name"), english);
  }

  @Test
  public void testCanFindByLabell10n() {
    By b = By.partialLinkText("label=l10n('sentenceFormat')");
    WebElement element = driver.findElement(b);
    Assert.assertEquals(element.getAttribute("label"), english);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.By

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.