Using a value from the request to check the response through Asserter
I am trying to verify that certain element in the response has the same text as another element in the corresponding request. Can you please help me understand how this can be done through XML Asserter?
Tagged:
0
Comments
In general, the XML Assertor is used to enforce the correctness of data in an XML message, commonly returned by a SOAP Client Tool or Messaging Tool. Here's a quick example, using a simple service that echoes back everything that is sent to it: At this point, the test has run, but we don't know if the echo service returned what we expected it to. So we will use the XML Assertor Tool to validate the response. This is done by chaining the XML Assertor to the SOAP Client or Messaging Tool: When the echoString(string) test runs, it generates XML output, which will be fed into the XML Assertor. The XML Assertor can then enforce data values. In this case, we want the XML Assertor to check the Result element of the response for the string "Hello World". You can also parameterize the values that you want to compare against each other. For example, you can add a Datasource to the Test Suite and parameterize the echoString(string) arg0 field. Then, in the XML Assertor, you can parameterize the Expected Value field to the same database column. For more on paramaterization, refer to the documentation: I hope this helps, and please let me know if you need further assistance.