Example usage for org.openqa.selenium.support.ui Select deselectByVisibleText

List of usage examples for org.openqa.selenium.support.ui Select deselectByVisibleText

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui Select deselectByVisibleText.

Prototype

@Override
public void deselectByVisibleText(String text) 

Source Link

Document

Deselect all options that display text matching the argument.

Usage

From source file:com.mkl.websuites.internal.command.impl.select.DeselectByTextCommand.java

License:Apache License

@Override
protected void doSelect(String text, Select select) {
    select.deselectByVisibleText(text);
}

From source file:dk.netarkivet.systemtest.functional.DomainsPageTest.java

License:Open Source License

@Test(groups = { "guitest", "functest" })
public void usedSeedListsFilteringTest() {
    addDescription(//from  w  ww .j a va2 s. c om
            "Tests seed lists are filtered correctly when " + "using the 'Show/Hide unused seed list' filter.");
    addStep("Create a new domain", "The edit domain page should be loaded with only the default "
            + "seed list show. The seed list filter state should be that "
            + "unused seed lists are hidden, eg. the filter link " + "text should 'Show unused seed lists.");
    String domain1ID = createDomainID();
    DomainWebTestHelper.createDomain(new String[] { domain1ID });
    List<WebElement> seedListRows = readSeedListTableRows(driver);
    NASAssert.assertEquals(1, seedListRows.size(), "More than one seed list listed in the new domain");
    NASAssert.assertTrue(seedListRows.get(0).getText().contains("defaultseeds"),
            "Didn't find the defaultseeds as the only seed list");

    addStep("Create a new seed list",
            "The seed list should not be listed initially as the seed list is hidden by the unused filter");
    String seedList1ID = createSeedListID();
    DomainWebTestHelper.createSeedList(domain1ID, seedList1ID, new String[] { domain1ID });
    NASAssert.assertEquals(1, seedListRows.size(), "More than one seed list listed after second "
            + "seed list was created. Should have been hidden by unused filter");

    addStep("Click the 'Show unused seed list' link",
            "The new seed list should appear in the seed list list as the second element.");
    PageHelper.clickLink(SHOW_UNUSED_SEED_LISTS_LINK);
    seedListRows = readSeedListTableRows(driver);
    NASAssert.assertEquals(2, seedListRows.size(), "The second seed list didn't appear in the list after "
            + "clicking the 'Show unused seed lists' link.");
    NASAssert.assertTrue(seedListRows.get(1).getText().contains(seedList1ID),
            "Didn't find the new seed list in the full seed list list.");

    addStep("Click the 'Hide unused seed lists' link",
            "The new seed list should disappear from the seed list list.");
    PageHelper.clickLink(HIDE_UNUSED_SEED_LISTS_LINK);
    seedListRows = readSeedListTableRows(driver);
    NASAssert.assertEquals(1, seedListRows.size(), "More than one seed list listed after second "
            + "seed list was created. Should have been hidden by unused filter");
    NASAssert.assertTrue(seedListRows.get(0).getText().contains("defaultseeds"),
            "Didn't find the defaultconfig as the only seed list");

    addStep("Add the new seed list to the default config (which is a used config)",
            "The seed list should now be listed");
    List<WebElement> configurationRows = readConfigurationTableRows(driver);
    configurationRows.get(0).findElement(By.linkText("Edit")).click();
    Select seedListSelect = new Select(driver.findElement(By.name("seedListList")));
    seedListSelect.selectByVisibleText(seedList1ID);
    driver.findElement(By.cssSelector("input[type=\"submit\"]")).click();
    seedListRows = readSeedListTableRows(driver);
    NASAssert.assertEquals(2, seedListRows.size(),
            "The second seed list didn't appear in the list after " + "it was added to the defaultconfig.");

    addStep("Remove the default seed list from the default configuration",
            "Only the new seed list should now be listed");
    configurationRows = readConfigurationTableRows(driver);
    configurationRows.get(0).findElement(By.linkText("Edit")).click();
    seedListSelect = new Select(driver.findElement(By.name("seedListList")));
    seedListSelect.deselectByVisibleText("defaultseeds");
    driver.findElement(By.cssSelector("input[type=\"submit\"]")).click();
    seedListRows = readSeedListTableRows(driver);
    NASAssert.assertEquals(1, seedListRows.size(), "The default seed list still showing  in the list after "
            + "it was removed from the defaultconfig.");
    NASAssert.assertFalse(seedListRows.get(0).getText().contains("defaultseeds"),
            "Found the defaultseeds in the used seed list list after "
                    + "it was removed from the defaultconfig.");
}

From source file:org.musetest.selenium.steps.DeselectOptionByText.java

License:Open Source License

@Override
protected void executeSelection(Select select, String option, StepExecutionContext context) {
    select.deselectByVisibleText(option);
}

From source file:org.openecomp.sdc.ci.tests.utilities.AdminWorkspaceUIUtilies.java

License:Open Source License

public static String selectUserRole(String Role) {
    Select selectrole = new Select(GeneralUIUtils.getWebElementWaitForVisible("selectrole"));
    selectrole.deselectByVisibleText(Role);
    selectrole.selectByVisibleText(Role);
    return Role;
}