Forum Discussion
- PramodYadav7 years agoContributor
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"
listsTBname =sql.rows(sqlTBname)
Now, you can assert the elements parsed from ResponseArray to the elements from this list (ex : )
assert listsTBname[0].columnName = ResponseArray[0].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!
Related Content
- 4 years ago
- 6 years ago
- 10 years ago
Recent Discussions
- 15 years ago