Java Code Examples for org.openqa.selenium.support.ui.Select#deselectAll()

The following examples show how to use org.openqa.selenium.support.ui.Select#deselectAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientScopesSetupForm.java    From keycloak with Apache License 2.0 6 votes vote down vote up
static void removeRedundantScopes(Select select, WebElement button, Collection<String> scopes) {
    boolean someRemoved = false;

    select.deselectAll();
    for (String scope : getSelectValues(select)) {
        if (scopes == null // if scopes not provided, remove all
                || !scopes.contains(scope)) { // if scopes provided, remove only the redundant
            select.selectByVisibleText(scope);
            someRemoved = true;
        }
    }

    if (someRemoved) {
        waitUntilElement(button).is().enabled();
        button.click();
    }
}
 
Example 2
Source File: ClientScopesSetupForm.java    From keycloak with Apache License 2.0 6 votes vote down vote up
static void addMissingScopes(Select select, WebElement button, Collection<String> scopes) {
    select.deselectAll();
    if (scopes != null) { // if scopes not provided, don't add any
        boolean someAdded = false;

        for (String scope : getSelectValues(select)) {
            if (scopes.contains(scope)) { // if scopes provided, add only the missing
                select.selectByVisibleText(scope);
                someAdded = true;
            }
        }

        if (someAdded) {
            waitUntilElement(button).is().enabled();
            button.click();
        }
    }
}
 
Example 3
Source File: SeleniumSelect.java    From phoenix.webui.framework with Apache License 2.0 5 votes vote down vote up
@Override
public boolean deselectAll(Element element)
{
	Select select = createSelect(element);
	if(select != null)
	{
		select.deselectAll();
		return true;
	}

	return false;
}
 
Example 4
Source File: BrowserTest.java    From hsac-fitnesse-fixtures with Apache License 2.0 5 votes vote down vote up
@WaitUntil
public boolean selectAs(String value, String place) {
    WebElement element = getElementToSelectFor(place);
    if (element != null) {
        Select select = new Select(element);
        if (select.isMultiple()) {
            select.deselectAll();
        }
    }
    return clickSelectOption(element, value);
}
 
Example 5
Source File: RoleCompositeRoles.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private void removeRedundantRoles(Select select, WebElement button, Collection<String> roles) {
    select.deselectAll();
    for (String role : getSelectValues(select)) {
        if (roles == null // if roles not provided, remove all
                || !roles.contains(role)) { // if roles provided, remove only the redundant
            select.selectByVisibleText(role);
        }
    }
    clickLink(button);
}
 
Example 6
Source File: RoleCompositeRoles.java    From keycloak with Apache License 2.0 5 votes vote down vote up
protected void addMissingRoles(Select select, WebElement button, Collection<String> roles) {
    select.deselectAll();
    if (roles != null) { // if roles not provided, don't add any
        for (String role : getSelectValues(select)) {
            if (roles.contains(role)) { // if roles provided, add only the missing
                select.selectByVisibleText(role);
            }
        }
        waitUntilElement(button).is().enabled();
        clickLink(button);
    }
}
 
Example 7
Source File: AttributesPage.java    From oxTrust with MIT License 4 votes vote down vote up
public void editType() {
	Select typeEdited = new Select(webDriver.findElement(By.className("editTypeField")));
	typeEdited.deselectAll();
	typeEdited.selectByValue("ADMIN");

}
 
Example 8
Source File: AttributesPage.java    From oxTrust with MIT License 4 votes vote down vote up
public void viewType() {
	Select typeViewed = new Select(webDriver.findElement(By.className("viewTypeField")));
	typeViewed.deselectAll();
	typeViewed.selectByValue("ADMIN");
}
 
Example 9
Source File: AttributesPage.java    From oxTrust with MIT License 4 votes vote down vote up
public void usageType() {
	Select typeUsed = new Select(webDriver.findElement(By.className("usageTypeField")));
	typeUsed.deselectAll();
	typeUsed.selectByValue("OPENID");
}