Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.Select


    justWait();
    select.selectByValue(value);
  }

  public static String getDropdownSelectedValue(By locator) {
    Select select = new Select(driver.findElement(locator));
    return select.getFirstSelectedOption().getAttribute("value");
  }
View Full Code Here


    @InSequence(2)
    public void newPublicPostTest() {
        driver.findElement(POST_AREA).clear();
        driver.findElement(POST_AREA).sendKeys(CODE_FRAGMENT);

        new Select(driver.findElement(SYNTAX_SELECT)).selectByVisibleText(JS_SYNTAX);

        driver.findElement(NAME_INPUT).clear();
        driver.findElement(NAME_INPUT).sendKeys("PublicTester");

        guardHttp(driver.findElement(SUBMIT_BUTTON)).click();
View Full Code Here

    @InSequence(3)
    public void newPrivatePostTest() {
        driver.findElement(POST_AREA).clear();
        driver.findElement(POST_AREA).sendKeys(CODE_FRAGMENT);

        new Select(driver.findElement(SYNTAX_SELECT)).selectByVisibleText(JS_SYNTAX);
        new Select(driver.findElement(EXPOSURE_SELECT)).selectByVisibleText(PRIVATE_EXPOSURE);

        driver.findElement(NAME_INPUT).clear();
        driver.findElement(NAME_INPUT).sendKeys("PrivateTester");

        guardHttp(driver.findElement(SUBMIT_BUTTON)).click();
View Full Code Here

        driver.findElement(USER_SEARCH_INPUT).sendKeys("graham");

        driver.findElement(DATE_SEARCH_INPUT).clear();
        driver.findElement(DATE_SEARCH_INPUT).sendKeys("2009-02-02");

        new Select(driver.findElement(SYNTAX_SELECT)).selectByVisibleText(JS_SYNTAX);

        driver.findElement(CODE_SEARCH_INPUT).clear();
        driver.findElement(CODE_SEARCH_INPUT).sendKeys("toggle_visibility(id)");

        guardHttp(driver.findElement(SEARCH_BUTTON)).click();
View Full Code Here

    @InSequence(6)
    public void searchAndPaginationTest() {
        guardHttp(driver.findElement(HISTORY_LINK)).click();
        driver.findElement(USER_SEARCH_INPUT).clear();
        driver.findElement(USER_SEARCH_INPUT).sendKeys("martin");
        new Select(driver.findElement(SYNTAX_SELECT)).selectByVisibleText(ANY_SYNTAX);

        driver.findElement(DATE_SEARCH_INPUT).clear();
        driver.findElement(CODE_SEARCH_INPUT).clear();

        guardHttp(driver.findElement(SEARCH_BUTTON)).click();
View Full Code Here

        super(driver);
    }

    public EditRoleAssignmentPage selectPolicy(String policy) {
        log.info("Select policy {}", policy);
        new Select(waitForWebElement(policySelect)).selectByValue(policy);
        return new EditRoleAssignmentPage(getDriver());
    }
View Full Code Here

        return new EditRoleAssignmentPage(getDriver());
    }

    public EditRoleAssignmentPage selectRole(String role) {
        log.info("Select role {}", role);
        new Select(waitForWebElement(roleSelect)).selectByValue(role);
        return new EditRoleAssignmentPage(getDriver());
    }
View Full Code Here

        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

  }

  protected void selectOptionByText(WebElement selectField, String optionText) {
    $(selectField).should(exist);
    $(selectField).find(byText(optionText)).shouldBe(visible);
    new Select(selectField).selectByVisibleText(optionText);
  }
View Full Code Here

  }

  protected void selectOptionByValue(WebElement selectField, String optionValue) {
    $(selectField).should(exist);
    $(selectField).find(byValue(optionValue)).shouldBe(visible);
    new Select(selectField).selectByValue(optionValue);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.Select

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.