I want the value of meta keywords and it returns null in both the cases
- When it is really null
- and when XPath doesn't even exist, which is wrong because when XPath does not present it should give an error that there is no such thing as meta keyword on the page.
So what I want is to look for the value of meta keyword only if below XPath exists.
//html/head/meta[@name='keywords']/@content
if (keywordXPath.exists()){ // ----> how to do it in Groovy JSR223 Assertion?
if (keyword.equals("") || keyword == null) {
// to do
} else {
// to do
}
}
How can I check XPath present or not in Groovy JSR223 Assertion?