All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clarolab.selenium.pages.actions.WebElementHelpers Maven / Gradle / Ivy

Go to download

Framework for automated testing using Selenium. Provides easy configuration of WebDrivers with BrowserFactory. Provides a Page abstraction.

The newest version!
package com.clarolab.selenium.pages.actions;

import com.google.common.collect.Lists;
import org.openqa.selenium.WebElement;

import java.util.List;

public class WebElementHelpers {

    public static boolean webElementHasClass(WebElement webElement, String className) {
        return getClasses(webElement).contains(className);
    }

    public static List getClasses(WebElement webElement) {
        if (webElement.getAttribute("class") == null) {
            return Lists.newArrayList();
        }
        return Lists.newArrayList(webElement.getAttribute("class").split("\\s+"));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy