• About
  • Professional Info
  • Zaharia Bârsan
  • Poetry

Dan Bârsan

~ The miracle is not that we do this work, but that we are happy to do it. I'm writing in Romanian and English

Dan Bârsan

Monthly Archives: May 2015

Running SoapUI Standard version with DataSource and DataLoop groovy

12 Tuesday May 2015

Posted by Birsan Dan in JAVA, SOA

≈ Leave a comment

Tags

DataLoop, DataSource, Groovy

soapUI_groovy
Running SoapUI Standard version with DataSource and DataLoop groovy

This is what goes into the DataSource groovy file.


/*
@Author : Dan Birsan
@Description : Data Source to read .csv file and pass the value to corresponding property.
@GroovyTestStepName : "DataSource"
*/

import com.eviware.soapui.support.XmlHolder
def myTestCase = context.testCase
def counter,next,previous,size
File tickerEnumFile = new File("T:\\Dan\\FTC HL7 - UC8 Test Data 2014-05-21 Random_2.csv")
//make sure input.txt file already exists and contains different set of values sepearted by new line (CR).
List lines = tickerEnumFile.readLines()
size = lines.size.toInteger()
propTestStep = myTestCase.getTestStepByName("Properties") // get the Property TestStep
propTestStep.setPropertyValue("Total", size.toString())
counter = propTestStep.getPropertyValue("Count").toString()
counter= counter.toInteger()
next = (counter > size-2? 0: counter+1)
tempValue = lines[counter]

//Split the first line into a string array and assign the array elements to various test case properties
String[] propData = tempValue.split(",")

propTestStep.setPropertyValue("HL7EventType", propData[0])
propTestStep.setPropertyValue("SendingFacility", propData[2])
propTestStep.setPropertyValue("memIDNum", propData[4])
propTestStep.setPropertyValue("PatientIDAssigningAuthority1", propData[5])
propTestStep.setPropertyValue("PatientIDAssigningAuthority2", propData[8])
propTestStep.setPropertyValue("PatientIDAssigningAuthority3", propData[12])
propTestStep.setPropertyValue("PID", propData[7])
propTestStep.setPropertyValue("PIDType", propData[11])
propTestStep.setPropertyValue("Surname", propData[13])
propTestStep.setPropertyValue("Givename", propData[14])
propTestStep.setPropertyValue("DOB", propData[15])
propTestStep.setPropertyValue("Gender", propData[16])
propTestStep.setPropertyValue("StreetAddress", propData[17])
propTestStep.setPropertyValue("City", propData[18])
propTestStep.setPropertyValue("State", propData[19])
propTestStep.setPropertyValue("PostalCode", propData[20])
propTestStep.setPropertyValue("Telephone", propData[21])
propTestStep.setPropertyValue("AreaCode", propData[22])
propTestStep.setPropertyValue("PID_OID", propData[23])

propTestStep.setPropertyValue("Count", next.toString())
next++
// log.info "Reading line : ${(counter+1)} / $lines.size"
propTestStep.setPropertyValue("Next", next.toString())
// log.info "Value '$tempValue' -- updated in $propTestStep.name"
if (counter == size-1)
{
propTestStep.setPropertyValue("StopLoop", "T")
// log.info "Setting the stoploop property now..."
}
else if (counter==0)
{
def runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testRunner.testCase, null)
propTestStep.setPropertyValue("StopLoop", "F")
}
else
{
propTestStep.setPropertyValue("StopLoop", "F")
}

And this is what goes into the DataLoop groovy file.


/*
@Author : Dan Birsan
@Description : Data Source Looper responsible for looping a specific teststep.
@GroovyTestStepName : "DataLoop"
*/

def myTestCase = context.testCase
def runner
propTestStep = myTestCase.getTestStepByName("Properties") // get the Property TestStep
endLoop = propTestStep.getPropertyValue("StopLoop").toString()

if (endLoop.toString() == "T" || endLoop.toString()=="True" || endLoop.toString()=="true")
{
 log.info ("Exit Groovy Data Source Looper")
 assert true
}
else
{
 testRunner.gotoStepByName("DataSource") //setStartStep
}

Advertisement

Rate this:

Facebook activity

Facebook activity

How are you my friend?

Dan Birsan

Agile Architecture Artificial intelligence Business Intelligence HL7 JAVA Management Poetry Puzzle QA Quotes SOA Social Networking

Archives

  • October 2019
  • September 2019
  • April 2019
  • December 2018
  • January 2018
  • July 2017
  • July 2016
  • June 2016
  • October 2015
  • September 2015
  • May 2015
  • March 2015
  • November 2014
  • October 2014
  • September 2014
  • May 2014
  • April 2014
  • March 2014
  • June 2013
  • April 2013
  • March 2013
  • November 2012
  • September 2012
  • August 2012
  • June 2012
  • September 2011
  • August 2011
  • June 2011
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • November 2009
  • October 2009
  • July 2009

Categories

  • Agile
  • Architecture
  • Artificial intelligence
  • Business Intelligence
  • HL7
  • JAVA
  • Management
  • Poetry
  • Puzzle
  • QA
  • Quotes
  • SOA
  • Social Networking
May 2015
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Mar   Sep »

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 41 other subscribers

Dan Barsan Twitter

  • Domnul Tudor voci.ro/domnul-tudor/ via @pntcdbv 1 year ago
  • Vasile Motrescu, o istorie care nu se învață la școală voci.ro/vasile-motresc… via @pntcdbv 1 year ago
  • Meseria de istoric la începutul mileniului al treilea voci.ro/meseria-de-ist… via @pntcdbv 6 years ago
  • PNTCD Brasov: Neamul nostru rumânesc pntcdbrasov.blogspot.com/2015/10/neamul… 7 years ago
Follow @danbirsan

Facebook activity

Facebook activity

How are you my friend?

Dan Birsan

Agile Architecture Artificial intelligence Business Intelligence HL7 JAVA Management Poetry Puzzle QA Quotes SOA Social Networking

Archives

  • October 2019
  • September 2019
  • April 2019
  • December 2018
  • January 2018
  • July 2017
  • July 2016
  • June 2016
  • October 2015
  • September 2015
  • May 2015
  • March 2015
  • November 2014
  • October 2014
  • September 2014
  • May 2014
  • April 2014
  • March 2014
  • June 2013
  • April 2013
  • March 2013
  • November 2012
  • September 2012
  • August 2012
  • June 2012
  • September 2011
  • August 2011
  • June 2011
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • November 2009
  • October 2009
  • July 2009

Categories

  • Agile
  • Architecture
  • Artificial intelligence
  • Business Intelligence
  • HL7
  • JAVA
  • Management
  • Poetry
  • Puzzle
  • QA
  • Quotes
  • SOA
  • Social Networking
May 2015
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Mar   Sep »

IT Services

  • esbar – Consulting Technology

Politic

  • Daniel Remus Veres
  • PNTCD Brasov

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 41 other subscribers

Dan Barsan Twitter

  • Domnul Tudor voci.ro/domnul-tudor/ via @pntcdbv 1 year ago
  • Vasile Motrescu, o istorie care nu se învață la școală voci.ro/vasile-motresc… via @pntcdbv 1 year ago
  • Meseria de istoric la începutul mileniului al treilea voci.ro/meseria-de-ist… via @pntcdbv 6 years ago
  • PNTCD Brasov: Neamul nostru rumânesc pntcdbrasov.blogspot.com/2015/10/neamul… 7 years ago
Follow @danbirsan

Live traffic

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Dan Bârsan
    • Join 26 other followers
    • Already have a WordPress.com account? Log in now.
    • Dan Bârsan
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...