tag:blogger.com,1999:blog-33694095.post2473662061063406462..comments2023-11-02T01:41:20.825-07:00Comments on !! Learn soapUI !!: Groovy 5 - adding basic assertion using Groovy in soapUIPradeep Bishnoihttp://www.blogger.com/profile/05384476327685064993noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-33694095.post-58296262859209015012017-01-13T10:22:16.813-08:002017-01-13T10:22:16.813-08:00Hi,
I want to add SLA assertion in each and everyt...Hi,<br />I want to add SLA assertion in each and everytc under 1 test suite. Is there any way to do it. I have 100 tc in 1 test suite. I don't want to go 1 by by. Could you plz suggest step by step method if there is a way. It will be appreciated. Thanks..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-33694095.post-61474162031448538312015-08-26T12:45:09.246-07:002015-08-26T12:45:09.246-07:00Hi, Pradeep:
wsdlTestSteps[it], what is this [it]...Hi, Pradeep:<br /><br />wsdlTestSteps[it], what is this [it] stand for in the script? Thanks!<br /><br />DavidBITIOTEKhttps://www.blogger.com/profile/14077224674556746720noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-88294305471856770542013-04-27T23:00:08.203-07:002013-04-27T23:00:08.203-07:00Hi i am swapnil. i want add some advance assertion...Hi i am swapnil. i want add some advance assertion. how to add NotContains or Contains assertion using Scriptswapnilhttps://www.blogger.com/profile/17572834900569336964noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-15696552009583898222012-11-29T23:09:31.169-08:002012-11-29T23:09:31.169-08:00my mail id is trupthim@gmail.com..Request to plz h...my mail id is trupthim@gmail.com..Request to plz help me find the solution<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-33694095.post-37869463547725646362012-11-29T23:07:16.323-08:002012-11-29T23:07:16.323-08:00Hi Pradeep,
I am Trupthi here.I have added one Tes...Hi Pradeep,<br />I am Trupthi here.I have added one Test Request to which i am passing 10 different data through Data Source.<br /><br />Now i want to add 10 different assertion to each data.<br /><br />How can i do this please help me.<br /><br />Regards,<br />TrupthiAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-33694095.post-87225985638391019732012-06-04T02:14:40.361-07:002012-06-04T02:14:40.361-07:00Hi Pradeep,
I want to generate the test sui...Hi Pradeep,<br /> I want to generate the test suite and test cases randomly from the project.xml file, will it be possible to do so. Everything i want to automate with groovy script..<br /><br />The input should be the wsdl files, and test-request.xml files and output will be the test case execution report.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-33694095.post-29615677556966069082012-06-01T02:34:19.302-07:002012-06-01T02:34:19.302-07:00hi pradeep
I am testing a web service through soa...hi pradeep<br /><br />I am testing a web service through soap ui.I need to compare the data in the response with the expected data and print test success or failure.<br />please help..<br /><br />Taruntarunnoreply@blogger.comtag:blogger.com,1999:blog-33694095.post-23250880098918591052012-02-23T03:25:39.412-08:002012-02-23T03:25:39.412-08:00If I understood the question correctly, Pradeep is...If I understood the question correctly, Pradeep is not merely adding 'SOAP Fault' assertion on the test steps, the solution where we actually expect SOAP fault?<br /><br />Regards,<br />AjayAjayhttps://www.blogger.com/profile/14536666807141411127noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-26182396664261249382012-02-23T03:24:15.639-08:002012-02-23T03:24:15.639-08:00This comment has been removed by the author.Ajayhttps://www.blogger.com/profile/14536666807141411127noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-42818562493862745502012-02-23T03:19:01.038-08:002012-02-23T03:19:01.038-08:00Thanks Pradeep for the quick reply.
I am happy wi...Thanks Pradeep for the quick reply.<br /><br />I am happy with answer 2 and 3. <br /><br />I will PM you and explain you what I have done for 1. You can suggest what needs to be done to achieve what I want.<br /><br />Thanks,<br />AjayAjayhttps://www.blogger.com/profile/14536666807141411127noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-63360394473381041972012-02-21T09:11:50.692-08:002012-02-21T09:11:50.692-08:00Hi Ajay,
Thanks for your feedback.
1. Yes, it is ...Hi Ajay,<br /><br />Thanks for your feedback.<br />1. Yes, it is a Groovy Script Test Step and you need to run it once, rest (adding basic assertion in all WSDL teststep) would be taken care. To achieve the later you need to write a plugin.<br /><br />2. I had index 1 because of my SampleTestSuite count under selected project was 2. And i guess you only have a single TestSuite under the selected project hence OutOfBoundException.<br /><br />3. Just trying to figure out for which scenario the order of Assertion would play a role. Anyways, that can be achieved by moving the assertion index - moveassertion(int ix, int whereTo)<br /><br />refer API docs for more details :<br />http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/teststeps/WsdlTestRequestStep.html#moveAssertion(int,%20int)<br /><br />I hope this will help.<br /><br />Regards,<br />{Pradeep Bishnoi}Pradeep Bishnoihttps://www.blogger.com/profile/05384476327685064993noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-24241183850898849792012-02-21T08:59:21.302-08:002012-02-21T08:59:21.302-08:00Hi Deepesh,
Happen to see your comment today so a...Hi Deepesh,<br /><br />Happen to see your comment today so adding my reply (might be useful for others).<br />Yes, add a generic script assertion and then a Xpath expression (inside the script) can be used to identify if the response contains tag with some specific value (InvalidClient or Application etc). Hope this will help.<br /><br />Regards<br />{Pradeep Bishnoi}Pradeep Bishnoihttps://www.blogger.com/profile/05384476327685064993noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-72917871544483391562012-02-21T07:22:59.458-08:002012-02-21T07:22:59.458-08:00Hello Pradeep for helping soapUI community through...Hello Pradeep for helping soapUI community through your posts. You are doing wonderful job. I have to made following points on your above post.<br /><br />1. You said the script is write once and it will add same assertions at all the test requests? Have I understood incorrectly? I just added these lines of code and I can see two assertions were successfully created in the test request where I added before my test request step. Is there any way to make this script available for all test requests without exclusively adding the script as a groovy step again and again.<br /><br />2. The code worked with minor change at the below line<br /><br />def testSuite = project.getTestSuiteAt(1)<br /><br />It was throwing arrayIndexOutOfBoundException. I just made index as 0 and it worked. Any reason you see?<br /><br />3. One more drawback I see with this approach is that sometimes we need to order assertions in specific order. With this approach assertions are added at the end below existing assertions and they all will be executed in the serial order. Is there any way we can add them at the desired place?<br /><br />Anticipating quick reply from you.<br /><br />Thanks<br />AjayAjayhttps://www.blogger.com/profile/14536666807141411127noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-61053158942957159342011-09-12T13:14:48.510-07:002011-09-12T13:14:48.510-07:00Hi Pradeep, great article. I have designed a test ...Hi Pradeep, great article. I have designed a test bed such that some of the test case actually expect a SOAP Fault. Is there a way I can kick off an assertion to check whether the response is SOAP Fault from a script?Deepeshhttps://www.blogger.com/profile/05809523576179577602noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-75068378851719242552011-06-09T06:13:37.748-07:002011-06-09T06:13:37.748-07:00Hi Rohit,
If i understood your question correctly...Hi Rohit,<br /><br />If i understood your question correctly, you want to copy the script assertion only from one teststep to another.<br /><br />By default the name of the Script Assertion would be "Script Assertion". So you can use this as one of the condition check (like SOAP response) and clone it.<br /><br />Or in case if you script assertion name is different (like user defined) then use the below code lines (inside the loop) to get the name of assertion and clone the assertion.<br /><br />log.info(testStepSrc.getAssertionAt(count).getName())<br /><br />I hope this will help. Else provide more details :-)<br /><br />~~ Pradeep Bishnoi ~~Pradeep Bishnoihttps://www.blogger.com/profile/05384476327685064993noreply@blogger.comtag:blogger.com,1999:blog-33694095.post-52453719229454905412011-06-07T06:32:32.695-07:002011-06-07T06:32:32.695-07:00Hi Pradeep,
This post is of great use for my proj...Hi Pradeep,<br /><br />This post is of great use for my project.<br /><br />Please let me know how the Script Assertion (with expected script being in the body part of the assertion)can be configured in the similar line.<br /><br />Thanks<br />Rohit BorseRohit Borsehttps://www.blogger.com/profile/17322738566906515541noreply@blogger.com