Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Need help with Partial Value checking in Conditions on Multiple Responses XML Msg Responder

satishms10
satishms10 Posts: 21

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

  • williammccusker
    williammccusker Posts: 666 ✭✭✭

    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?

  • satishms10
    satishms10 Posts: 21

    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,
    Sati

  • williammccusker
    williammccusker Posts: 666 ✭✭✭

    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"

  • satishms10
    satishms10 Posts: 21

    Hi William,

    I will try and update here tomorrow.

    Thank you..

    Sati

  • satishms10
    satishms10 Posts: 21

    Hi William,

    Below method worked as expected.

    Thanks,
    Sati

  • williammccusker
    williammccusker Posts: 666 ✭✭✭

    Glad to hear it worked!