Forum Discussion

krogold's avatar
krogold
Regular Contributor
7 years ago

Conditional goto : is it possible to trigger on a OR condition ?

Hi,

I'm using an asynchronous API so, in order to detect when my transaction is finished, I use a conditional goto that triggers when my condition becomes different from 'pending': this works perfectly.

After recovering my execution status, after a small time, my result changes again. I want to do a further checking on that new result, and so I want to do a conditional goto that triggers when my condition becomes different from my result, ie. 'Success' or 'Failed'.

is it possible to do a OR condition in my trigger condition ?

 

thank you

 

Alexandre

5 Replies

  • Conditional GO TO step is good but it is limited to XML responses and also has a couple of other limitation. We have specific steps for Asynchronous calls which can actually wait until something is triggered to further validate the responses once the process is finished. Here are some links to the steps that may help you.

     

    File Wait (waits for a file to appear in your local directory and then continues with the next steps in the testcase):

    https://support.smartbear.com/readyapi/docs/soapui/steps/file-wait.html

     

    REST VirtResponse(opens a listener on an endpoint:port and waits for a message to come through and then continues with the next steps in the testcase):

    https://support.smartbear.com/readyapi/docs/soapui/steps/rest-virt-response.html

     

    Property Wait(Waits for a property in any location of your choice and once it appears the next steps in the testCase will be executed):

    https://support.smartbear.com/readyapi/docs/soapui/steps/property-wait.html

     

    There might be couple of other ways you can deal with async calls but I hope this helps.

     

     

    Regards,

    Temil Sanchez

    • nmrao's avatar
      nmrao
      Champion Level 3
      Thank you for the different available options.

      Not sure if this is relevant in this context, but want to add this and looking to hear from you.

      In groovy script, it is possible to (skip some steps) use "gotoStep" which actually does nothing i.e., does not execute the given step. Any comments on it?
      • TSanchez_1's avatar
        TSanchez_1
        Moderator

        Not sure that does anything either, try using "goToStepByName("test step name").

    • krogold's avatar
      krogold
      Regular Contributor

      Thank you for all these possible ways but, I 'd like to know if there is an 'easy' way to do so.

      currently I have this:

      declare namespace ns1='http://xxxxxxxxxxxxx/';
      declare namespace a='http://xxxxxxxxxxxxxxxxxxxxxx/2004/07/xxxxxxxxxxxxxx';
      //ns1:GetPendingRequestResponse[1]/ns1:GetPendingRequestResult[1]/a:Status[1]="Success"

      is it possible to something just like

      //ns1:GetPendingRequestResponse[1]/ns1:GetPendingRequestResult[1]/a:Status[1]="Success" ||"Failed" ?

      When I do this, I end up with "missing matching condition, moving on" ...