Forum Discussion

MPurchasing's avatar
MPurchasing
Occasional Contributor
10 years ago

Transfering Property Value that "Less than" OR "equal to"

Hello everyone,

I will appreciate if someone can help me with this. Thanks so much in advance for your time and effort.

This is my TestCase:

TestStep1: Get Data from the SQL Database.
Values are retrieved successfully and transferred to Properties
For example:
    Property1
    Property2
    Property3


TestStep2: Run the SOAP Request 1
Populate the SOAP Request data with the property values from step 1.
For example:
    <Firstname>${GetDataFromDB#Property1}</Firstname> //this one works
    <Lastname>${GetDataFromDB#Property2}</Lastname> //this one works
    <Age> ${GetDataFromDB#Property3} </Age> // I need help with this


What I want to do with the age field: Get only the data from step 1 that is less than or equal to 40

TestStep3: Run the SOAP Request 2
Populate the SOAP Request data with the property values from step 1.
For example:
    <Firstname>${GetDataFromDB#Property1}</Firstname> //this one works
    <Lastname>${GetDataFromDB#Property2}</Lastname> //this one works
    <Age> ${GetDataFromDB#Property3} </Age> // I need help with this


What I want to do with the age field: Get only the data from step 1 that is less than or equal to 20

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    This is definitely possible although you cannot achieve this with out of the box functionality. You will have to write a groovy script that gets the value that its less than x if else y and out put this into a property. To set properties via groovy please use this:

    http://www.soapui.org/Scripting-Propert ... properties

    Then you can use the property expansion from the property you created from your groovy script. Let me know if you have further questions.

    Regards,
  • MPurchasing's avatar
    MPurchasing
    Occasional Contributor
    I need to set-up something simple and straightforward for the client and groovy scripting might be too intimidating for them.

    I will try to work around this situation so the tests remain easy enough to maintain. I hope you understand.

    Thou I don't mind if you have other suggestions.

    Thanks for the reply.