Need help with Partial Value checking in Conditions on Multiple Responses XML Msg Responder
Hi There,
I am new to Parasoft virtualization, I am creating a virtual service using "Plain XML Message Responder" with Multiple Responses.
I wanted to check the "param1" value (from Request Body) of first two characters only to match the request under "Conditions" as shown in the attached picture.
Can I use wildcard characters or Regular Expression? or do I need to write the custom script to achieve this?
Kindly advise.
Please help me with script if we need to write or direct me to some learning docs related to Custom scripts for "Conditions"
Thanks,
Answers
-
Hi,
Do you want it to match when param1 is present? Or when it has a specific value(s)? From the screenshot I see "11" and "[*]" so is the desire to match any value? Or just when it's 11?
0 -
Hi William,
I wanted to check first two characters of param1 field of incoming xml request. Field param1 will have 8 to 10 characters value.
11[*] - means starts with 11 and any value after that for the param1 field.
Thanks,
Sati0 -
Hi,
Maybe change the end of the xpath to this? Replace "param1/text()" with the following≈
param1[starts-with(text(), "11")]
It uses an xpath function to check if the text value starts with "11"
0 -
Hi William,
I will try and update here tomorrow.
Thank you..
Sati
0 -
Hi William,
Below method worked as expected.
Thanks,
Sati0 -
Glad to hear it worked!
2