Quote from the offical document: https://docs.katalon.com/katalon-studio/docs/handle-response-messages.html
XML data are similar both in the structure and the way we define element locator , our expected info may come from: the attribute of XML tag (in example below, " no" is an attribute of " contacts" tag) or from inner child tag, you can use keywords for handling text (e.g. verifyElementText) or property (e.g. verifyElementPropertyValue) respectively.
In the screenshot, you can find a sample code
verifyElementText(responseObject, "GetEmployeeResponse.employee.contacts.email", "email:kms-techn...)
The locator in this sample silently skips <soap:Envelope>
and <soap:Body>
element ( The magical XPath //*//*//*
does this skipping). In other words, you are NOT supposed to write like this:
verifyElementText(responseObject, "Envelope.Body.GetEmployeeResponse.employee.contacts.email", "email:kms-techn...)
I think that the former locator is mysterious. Why Envelope
element and Body
element are skipped in the locator? It it right or not?
I think that the latter locator is intuitive and definitive. Here I should write an absolute GPath starting from the Document root (Envelope
) going down the layers of nodes (Body.GetEmployeeResponse.employee.contacts
) to the element of my interest(email
). I find no mystery here.
I got confused: Which way the keyword requires? I read the official document, but it does not answer to my question.
Therefore I would argue that users should not use the WS.verifyElementText()
keyword for XML because of the poor documentation.