We have build an awesome framework in SoapUI using heavy groovy scripting. Since much of it was learned over time from internet, we feel its our time to show our gratitude and give back to community.
What we have found is you can pretty much achieve anything and everything that you need in your project, using Groovy scripting.
In this thread, I will share some of the cool things we achieved and some tips-tricks/code snippets to get you interested in exploring the power of groovy. I would also like to invite you to share your tips-tricks-questions in comments below. So here are some of the elements of our framework:
If you are curious to know more about any of these aspects, do let know in comments below. If you have some tricks up your sleeve, I will be happy to learn them from you. If you have a problem statement bothering you and you see similarities above, do ask here. May be I or someone in community have an answer?
P.S: Special thanks to Mr @nmrao , who made my initial experience here in this community a memorable ones (when I started somewhere last year). Although we have only few questions to and fro, but you truly are doing a remarkable work helping folks in need :). Thank you.
The question is a little wage but if I understand the gist of your question, you want to compare the xml response of service with corresponding data stored in DB2 tables - right?
If so, Parse the o/p using xmlparser and store it in say an array (you can find ways to do it on internet). Write the sql statement for the expected o/p in table, and create a list using this sql statement. Something like below :
' First register the JDBC driver in a grooy scipt as:
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver(" com.ibm.db2.jcc.DB2Driver" ) ' Ofcourse i assume you have already placed a db2 driver in this folder " programfiles -> smartbear -> soapui your version -> bin -ext (if not copy paste one)
sql = Sql.newInstance(" jdbc:db2://servername : portnr/DBName,yourusername,yourpwd,"com/ibm.db2.jcc.db2Driver" );
sqlTBname = " select * from ...whatever"
Now, you can assert the elements parsed from ResponseArray to the elements from this list (ex : )
assert listsTBname.columnName = ResponseArray.responseElement
I assume this would give you an idea, you would still need to work out the other details, such as finding connection string details and adding for loops, in case if there is a need to iterate more elements in responseArray. Hope this helps!
I am new to SOAPUI Pro and we are planing to build the Frame work and i have gone through your apporch and it was awesome. It would be great if you share the base of this frame work to my id:email@example.com.
Thanks in Advance.
I would not be able to share my project framework since it contains client information, however in future I do intend to create some code snippets to share the general keywords for others use. For now, what I can do is, help you with any specific problems you are facing at this moment. I can share code snippets or suggestions that you may be able to customise for your project.
Do let me know if that helps?
I didnt hear from you. Nonetheless I am working on putting all my knowledge and experience into a general purpose book on how to build frameworks in SoapUI. Hopefully in few weeks or months, I could share more with you. In between, if you have any generic question, do not hesitate to ask.
Hi Pramod, Can you please let me know/ provide code sample for teh below
1. how to read the values from the External files from remote system ?
2. How to capture the failed test case logs , failed rest API request reponse and capture that in the external file?