header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
January 09, 2009, 07:43:06 am
Username: Password:
Login with username, password and session length

Forgot your password?
 
Running testStep in groovy script
Welcome, Guest. Please login or register.
January 09, 2009, 07:43:06 am
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  Running testStep in groovy script
« previous next »
Pages: [1] Print
Author Topic: Running testStep in groovy script  (Read 672 times)
Bram Baptiste
Newbie
*
Posts: 6


« on: February 20, 2008, 07:10:08 pm »

Hi,

I want to do 50 times a testStep with different parameters in a loop.
I think the best way to do this is in a groovy script.

the teststep is createTerminal.

But in the loop the mac address of the createTerminal has to change.

Is this feasible?

And if yes, can somebody guide me the way?

Tia, Bram
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #1 on: February 21, 2008, 12:58:13 am »

Hi!

This sounds like a candidate requirement for the DataSource related functionality in soapUI Pro. Are you?

If you are not using soapUI Pro, then groovy scripts will do the trick as well (a bit more work though..). Have a look at the template-data data scenario to get the idea: http://www.soapui.org/userguide/scenarios/templatedriven.html

Hope this helps!

regards,

/Ole
eviware.com

Logged
darshan
Newbie
*
Posts: 3


« Reply #2 on: July 31, 2008, 09:08:21 pm »

1) Set the Property in the property file.
2) Next write a Property Transfer from the property to the request.
3) After this write a groovy script to to read from the Property file and change the property.
This can be done as follows:
def request = testRunner.testCase.getTestStepByName( "activateRequest" );
   def property = request.getProperty( "request" );
   
   //get the property value from the Property file
   def props = testRunner.testCase.getTestStepByName("Properties");
   String sNo = props.getPropertyValue("sNo");
Here sNo is the name of the property set.
4)Use XPATH to navigate the XML file.
use this command..its powerful..
//sNo/text()
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header