Forum Discussion

Pritish_Panda's avatar
Pritish_Panda
Contributor
9 years ago

Some time my groovy unable to set Soapui Project property though I have written the proper code .

Hi all,

 

   I am facing some problem with groovy code and SoapUI . My groovy code workfine some time and some time it doesn't .

 

Example-:  I have written a pice of groovy script which use to set project property of SoapUI and another pice of groovy Script to Unable TestSuite and TestCase if  it is disabl. 

But the problem here, it is working very inconsistently .  

 

Code -: 

To set Project Property -: 


//Get Project
def getProject = testRunner.testCase.testSuite.project

//Set Project IP Property in Project level
def IP = context.expand( '${Properties#IP}' )
getProject.setPropertyValue( "Project_IP", "$IP")

 

---------------------------------------------------------------------------------------------------

 

To enable TestSuite if its disable 

 

//get Project
def getProject = context.testCase.testSuite.project

 

//get Test Suite Name
def TestSuite_Name = context.expand( '${DataSource#TestSuite_Name}' )
log.info TestSuite_Name

 

//Enable the TestSuite

getProject.getTestSuiteByName(TestSuite_Name).setDisabled(false)

 

 

Thanks 

Pritish Panda