Package org.openqa.selenium.support.ui

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


import org.openqa.selenium.support.ui.Select;

public class ClearSelections implements StepType {
  @Override
  public boolean run(TestRun ctx) {
    new Select(ctx.locator("locator").find(ctx)).deselectAll();
    return true;
  }
View Full Code Here


  private void selectOptionByText(WebElement selectField, String optionText) {
    $(selectField).shouldBe(present);
    $(selectField, "option").shouldBe(present);
    // TODO wait until the element has option with given text
    new Select(selectField).selectByVisibleText(optionText);
  }
View Full Code Here

  private void selectOptionByValue(WebElement selectField, String optionValue) {
    $(selectField).shouldBe(present);
    $(selectField, "option").shouldBe(present);
    // TODO wait until the element has option with given value
    new Select(selectField).selectByValue(optionValue);
  }
View Full Code Here

    WebElement option = getSelectedOption(selectElement);
    return option == null ? null : option.getText();
  }

  private SelenideElement getSelectedOption(WebElement selectElement) {
    return wrap(new Select(selectElement).getFirstSelectedOption());
  }
View Full Code Here

        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");
        getRepositoryTestUtils().addExtension(extension);

        // Check if the section links point to the right repository.
        ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
        Select repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("All Extensions", repositorySelect.getFirstSelectedOption().getText());

        adminPage = adminPage.clickCoreExtensionsSection();
        repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("Core extensions", repositorySelect.getFirstSelectedOption().getText());

        adminPage = adminPage.clickInstalledExtensionsSection();
        repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("Installed extensions", repositorySelect.getFirstSelectedOption().getText());

        // Check that a remote extension appears only in the list of "All Extensions".
        SearchResultsPane searchResults = adminPage.getSearchBar().search("alice");
        Assert.assertNull(searchResults.getExtension(extensionId));
View Full Code Here

    }

    public void makeFiltering(String filterValue) {
//        selectByLabel(filterValue);
        WebDriver driver = ((WrapsDriver) getSelenium()).getWrappedDriver();
        Select select = new Select(driver.findElement(By.xpath(getXPath())));
        select.selectByVisibleText(filterValue);
        getLoadingMode().waitForLoad();
    }
View Full Code Here

        WebElement tabNameContainer = selectedTab.findElement(By.cssSelector("span"));
        return tabNameContainer.getText();
    }

    public void setCarManufacturer(String manufacturer) {
        Select manufacturerSelect = new Select(carManufacturerInput);
        manufacturerSelect.selectByVisibleText(manufacturer);
    }
View Full Code Here

                    .build()
                    .perform();
            }
           
            if ((element = getObject(".//*[@id='ares_phobos_autocomplete_autocompleteSelect']")) != null) {
              Select select = new Select(element);
              List <WebElement> options = select.getOptions();
              for (WebElement option: options) {
                if (option.getText().equals("hello")){
                  option.click();
                  saveElt.sendKeys(";" + Keys.RETURN);
                  break;
View Full Code Here

        return initPage(HomePage.class);
    }


    private void selectRole(int index) {
        (new Select(roleSingleSelectList)).selectByIndex(index);
    }
View Full Code Here

  public static String getElementValue(By locator) {
    return driver.findElement(locator).getAttribute("value");
  }

  public static void selectDropdownByValue(By locator, String value) {
    Select select = new Select(driver.findElement(locator));
    justWait();
    select.selectByValue(value);
  }
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.