Example usage for org.openqa.selenium By name

List of usage examples for org.openqa.selenium By name

Introduction

In this page you can find the example usage for org.openqa.selenium By name.

Prototype

public static By name(String name) 

Source Link

Usage

From source file:com.gargoylesoftware.htmlunit.selenium.TypingTest.java

License:Apache License

/**
 * A test.// w  w  w.  j a  v  a 2 s.  co  m
 */
@Test
public void generateKeyPressEventEvenWhenElementPreventsDefault() {
    final WebDriver driver = getWebDriver("/javascriptPage.html");

    final WebElement silent = driver.findElement(By.name("suppress"));
    final WebElement result = driver.findElement(By.id("result"));

    silent.sendKeys("s");
    assertThat(result.getText().trim(), is(""));
}

From source file:com.ggasoftware.jdiuitest.web.selenium.elements.pageobjects.annotations.WebAnnotationsUtil.java

License:Open Source License

public static By getFindByLocator(FindBy locator) {
    if (locator == null)
        return null;
    if (!"".equals(locator.id()))
        return By.id(locator.id());
    if (!"".equals(locator.className()))
        return By.className(locator.className());
    if (!"".equals(locator.xpath()))
        return By.xpath(locator.xpath());
    if (!"".equals(locator.css()))
        return By.cssSelector(locator.css());
    if (!"".equals(locator.linkText()))
        return By.linkText(locator.linkText());
    if (!"".equals(locator.name()))
        return By.name(locator.name());
    if (!"".equals(locator.partialLinkText()))
        return By.partialLinkText(locator.partialLinkText());
    if (!"".equals(locator.tagName()))
        return By.tagName(locator.tagName());
    return null;/*from www  .ja v a 2 s . co m*/
}

From source file:com.github.seleniumpm.tests.testlib.GooglePageWebDriver.java

License:Apache License

public GooglePageWebDriver(Selenium sel) {
    super(sel);
    searchField = new TextField(sel, By.name("q"));
}

From source file:com.github.wiselenium.elements.frame.FrameB.java

License:Open Source License

public boolean isAnyRadiobuttonChecked() {
    List<Radiobutton> radiobuttons = this.findElements(Radiobutton.class, By.name("boolean"));
    for (Radiobutton r : radiobuttons) {
        if (r.isChecked())
            return true;
    }//from  w  w w . jav a  2  s .c  o  m
    return false;
}

From source file:com.github.wiselenium.elements.frame.FrameB.java

License:Open Source License

public void checkRadiobutton(int i) {
    List<Radiobutton> radiobuttons = this.findElements(Radiobutton.class, By.name("boolean"));
    radiobuttons.get(i).check();/*from w  w w  . j  a v  a 2s . co  m*/
}

From source file:com.github.wiselenium.elements.frame.FrameC.java

License:Open Source License

public String getFrameCBATextValue() {
    return this.findElement(FrameCB.class, By.name("frame_cb")).getFrameCBATextValue();
}

From source file:com.github.wiselenium.elements.frame.FrameC.java

License:Open Source License

public String getFrameCBBTextValue() {
    return this.findElement(FrameCB.class, By.name("frame_cb")).getFrameCBBTextValue();
}

From source file:com.github.wiselenium.elements.frame.FrameC.java

License:Open Source License

public FrameC sendKeysToFrameCBAText(CharSequence... keys) {
    this.findElement(FrameCB.class, By.name("frame_cb")).sendKeysToFrameCBAText(keys);
    return this;
}

From source file:com.github.wiselenium.elements.frame.FrameC.java

License:Open Source License

public FrameC sendKeysToFrameCBBText(CharSequence... keys) {
    this.findElement(FrameCB.class, By.name("frame_cb")).sendKeysToFrameCBBText(keys);
    return this;
}

From source file:com.github.wiselenium.testng.example.GitHubExample.java

License:Open Source License

@Test
public void shouldTestWiseleniumTableOfFeatures() {
    this.get("https://github.com/wiselenium/wiselenium");
    Table table = this.findElement(Table.class, By.name("wiselenium-features"));

    for (TableRow bodyRow : table.getBody().getRows())
        assertEquals(bodyRow.getCell(1).getText(), "Yes");
}