Assertion and variable comparaison for a webservice
Hello,
I have a webservice which as //*:import_id_doc_stk in request part and has //*:export_id_doc_stk in response.
I won't explain the processing but I'd like to compare //*:import_id_doc_stk and //*:export_id_doc_stk in an assertion.
Is it possible? When I tried, it compared //*:export_id_doc_stk as if it is an actual string and not a variable.
Thank you for your help.
Edit: using a WSDL (calling mainframe)
The XPath Match assertion can compare a request field with a response field. Assuming the request and response belong to the same test step, and assuming there's just one element "import_id_doc_stk" in the request and one element "export_id_doc_stk" in the response, you can configure XPath Match as follows:
XPath Expression:
//*:export_id_doc_stk
Expected result:
${${=context.currentStep.label}#Request#//*:import_id_doc_stk}
or if #Request# does not work:
${${=context.currentStep.label}#RawRequest#//*:import_id_doc_stk}
${...} forces the expressions to be evaluated rather than treated as literal strings.