Ask a Question

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

krogold
Regular Contributor

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 5
TSanchez_1
Moderator

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

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

Temil Sanchez
Ready API Product Owner
nmrao
Community Hero

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

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?


Regards,
Rao.
TSanchez_1
Moderator

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

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

Temil Sanchez
Ready API Product Owner
nmrao
Community Hero

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

Yes, the same I was talking about. The mentioned method is used in a groovy script to execute the sequence of steps following the mentioned step passed as argument to that method. But it does not seem to work that way. Would you please confirm if that is the desired behavior or a defect?


Regards,
Rao.
krogold
Regular Contributor

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

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" ... 

cancel
Showing results for 
Search instead for 
Did you mean: