How can I check if a selenium web element contains a specific css class.
I have this html li element
Try using contains();
String classes = divPubli.getAttribute("class"); assertTrue("The element does not contain .maClass class .publi",classes.contains("maClass"));