How can I check if a selenium web element contains a specific css class.
I have this html li element
Simmilar to previous one, but with java 8 capabilities:
String classes= getDriver().findElement(someSelector).getAttribute("class");
Optional classFindResult = Arrays.stream(elementClasses.split(" ")).filter(el -> el.equals("myClass")).findFirst();
if(openClassFindResult.isPresent()){
return true;
}
return false;