Following XML is a snippet:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<documentDetail>
.
.
.
<attributes>
<attribute name="Description">
<value>My Description</value>
</attribute>
<attribute name="Remarks">
<value>My Remarks</value>
</attribute>
<attribute name="Title">
<value>My Title</value>
</attribute>
</attributes>
.
.
.
</documentDetail>
</soap:Body>
</soap:Envelope>
I want to verify the text of the value of the attribute which had “Description” as the name is “My Description”. I have used following code:
WSBuiltInKeywords.verifyElementText(response, 'documentDetail.attributes.attribute[@name="Description"].value', 'My Description')
While execution it is throwing an exception:
... Unable to verify element text (Root cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: = @ line 1, column 135.
ibutes.attribute[@name="Descript
^
1 error
)
What kind of GPath expression should I use to achieve the requirement? Is it an API bug?
Regards,
Tapas