Q:

How do I check if a word is present in the classname?

I'm trying to validate whether the string ("Pre laminated ") is is the css class name I'm trying to check.
I don't want to print the entire text in classname, just validate whether the given word is in the Classname or not: Print "pass" if the word exists, print "fail" if the word doesn't.

A:

I suppose you are talking about CSS classes, so thats the answer:
WebElement element = ...;
String className = element.getAttribute("class");
if (className.contains("Pre laminated")) {
    LOGGER.log("pass");
} else {
    LOGGER.log("fail");
}

