Groovy in SOAP UI
Operations with sql?instancePosted by: devakara on: October 17,2008
Groovy provides very robust methods with sql instance to retrieve and manipulate the ResultSet.? There are methods for retrieving the first row,?the ResultSet of some sql query,directly executing?insert/update/delete queries. Prerequisite: Obtain?sql?instance using
? Below are some comprehensive examples which use the above sql instance. firstRow( sqlQuery )?: This method returns the first row entity out of the ResultSet that is obtained by executing the query passed to it as?argument.
Result can accessed from?res?as
? eachRow( sqlQuery,{closure} )?: This method is generally used to retain/modify the whole ResultSet based on some condition. ?The second argument of this method i.e.,?clousure?actually consists as set of statements to be executed for each of the result set’s entity. For example
The println statements (present as a clousure) above are executed for each entity while iterating over the ResultSet,and?it?refers to the entity of ResultSet that is currently being iterated over.?Clousure can have any number of statements. ? execute( sqlQuery )?: Generally this method is used to INSERT/UPDATE/DELETE records,as it doesn’t return any ResultSet as such.?
Second type of usage is to some extent similar to PreparedStatement right? And the query could also be a INSERT/UPDATE statement,if developer wants to log some value(s) to database during execution of the TestStep. ?
Was the post informative?
? (Please feel free to get back if u have any trouble…as i’m just a mail away…otherwise leave a comment)
Tags:?
DB Operations with Groovy,?
groovy DB Select,?
groovy INSERT into DB,?
groovy SELECT from database,?
groovy DELETE from database,?
DB Select in Groovy,?
DB Insertion in Groovy,?
sql methods in Groovy,?
groovy sql.firstRow(),?
groovy sql.eachRow(),?
groovy sql.execute(),?
DB operations SOAP UI,?
sql connection SOAPUI,?
sql.eachRow() SOAPUI,?
sql.firstRow() SOAPUI,?
sql.execute() SOAPUI,?
sql firstRow() Groovy SOAPUI,?
sql eachRow() Groovy SOAPUI,?
sql execute() Groovy SOAPUI,?
sql execute groovy,?
sql firstRow groovy,?
sql eachRow groovy
Property Transfer in SOAP?UIPosted by: devakara on: October 8,2008
Property transfers become crucial steps in scenarios where validations are done?mostly?using derived data. Lets say after some Groovy script execution we end up setting a property value in Properties step while testing an application’s functionality. And most of the times we would be in need of the obtained result out of that groovy step. As we have it in Properties Step we can access it using Property Expansion technique and also using?Property Transfer?Step. Property Transfer Step shall be in between the Properties Step and SOAP request Step,but before placing the Transfer Step have Properties and SOAP request Steps in place. Property Transfer window would something like this: Property Transfer Step After creating a new Property Transfer in the above window say ‘RefNumTransfer‘,select source,in this case it would be the ‘Properties’ Step,this inturn provides the list of all properties defined under that Step,select the property you wish to transfer. Now come to Target block,where we would have our SOAP request to catch the property transfer. Initially declare all the namespaces that your request would use,separating each of them with ‘;’ and then provide the XPath of the target node which should capture the transfered value.? For example if the SOAP request as is below SOAP request to catch tranfered Property then the target block of Property Transfer should contain details like this: Declaring namespaces and adding target XPath Try running the Property Transfer step,you see the ‘Transfer Name’ and ‘Transfered Value’ in the Transfer Log,and also correspondingly that value is reflected in the SOAP request at the target XPath. ? (Please feel free to get back if u have any trouble…as I am just a mail away…leave otherwise a comment)
Tags:?
declaring namespaces in Property Transfer,?
property transfer,property transfer in SOAP UI,?
Property Transfer Step,?
property transfer to request xml,?
property transfer to SOAP request,?
target xpath,?
target xpath in Property Transfer,?
target xpath in SOAP UI,?
transfer,?
transfer in SOAP UI,?
Transfer properties,?
Transfer Property in SOAPUI
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |