Ask a Question

Is it possible to give a teststep response outcome to a next teststep? i.e. increased amount

Kevin902
New Contributor

Is it possible to give a teststep response outcome to a next teststep? i.e. increased amount

Example. I test a POST method of creating an account which increases the amount of accounts by 1. To test this function I also have a count (GET) function which should show me that the amount has increased by one. Now I can check this manually, but I want to be able to create a next teststep that validates that an extra account has been created so I dont have to check it manually. Is this possible? I am using the free version at the moment.

3 REPLIES 3
nmrao
Community Hero

Re: Is it possible to give a teststep response outcome to a next teststep? i.e. increased amount

Yes it is possible to do so with the help of scripting.

If you provide more details, that would be helpful.


Regards,
Rao.
Kevin902
New Contributor

Re: Is it possible to give a teststep response outcome to a next teststep? i.e. increased amount

Hey Rao,

 

 I have a GET function to count all active accounts of my login webservice. I want to build a check that checks the amount of accounts after a new account has been added. So I want it to validate a +1 scenario after the POST function has been successfully completed. For now I have a contains assertion in place with RegEx \d+ so I can atleast check if I am getting a number back. The response is in JSON btw.

 

Another problem I am facing is with a conditional goto. I have a connection check in place to validate access to the webservice. When it returns 'true', the testrun should continue. I do not want it to hog resources running the full script when the first step fails.

 

As you can see I am still missing some fundamental knowledge of scripting. Any help would be greatly appreciated.

 

Kevin

 

 

nmrao
Community Hero

Re: Is it possible to give a teststep response outcome to a next teststep? i.e. increased amount

It does not make sense to comment without seeing a sample data or in the same structure as you have the data; need not be your exact data.

All I can suggest is to take a look at the sample scripts available here and what is applicable to you and implement on your own.
https://github.com/nmrao/soapUIGroovyScripts/tree/master/groovy


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: