Learn soapUI - Open Source

In this series of Groovy blogs [numbered 10], i will be sharing very frequently  used “10 groovy scripts” which should be on your finger tips. These would come handy in order to perform any Automation using the Groovy in soapUI.

/* 
@Author : Pradeep Bishnoi
@Description : Collection of groovy script snippets required to achieve automation in soapUI
*/

1. Using Log variable
 log.info(“Any Text message ” + anyVariable)

2. Using Context variable
 def myVar = context.expand( ‘${#TestCase#SourceTestStep}’) //will expand TestCase property value into the new variable
    context.testCase  // returns the current testCase handle

3. Using TestRunner variable
 testRunner.testCase.getTestStepByName(“TestStepName”)
    testRunner.testCase // return the handle to current testCase
    testRunner.testCase.testSuite.project.testSuites[“My_TestSuite”]

4. Using MessageExchange variable
 messageExchange.getEndpoint() //endpoint to the selected teststep
    messageExchange.getTimestamp()    //timestamp
    messageExchange.getTimeTaken()    //time taken to process the request/response

5. Using Project, TestSuite, TestCase, TestStep methods
def project = testRunner.testCase.testSuite.project
    def project = context.testCase.testSuite.project

    def…

View original post 141 more words

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: