user3511026
user3511026

Reputation: 159

Global property is not getting added when saving it from groovy script using "launch test runner"

  1. Step 1 : I have a soap rest project, In that i am getting a userID from response.
  2. Step 2 : When i run the test case separately to get the userID, the groovy script for setting the user ID in global property is working fine.
    Refer : com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils.globalProperties.setPropertyValue('userID', 'ID from response')
  3. Step 3 : But when i run my whole project using "launch test runner" to get the userID from response and setting the userID to a global property as defined in the above example is not working.

Does any one have idea on this?

Thanks in advance for the answer.

Upvotes: 0

Views: 352

Answers (1)

Rao
Rao

Reputation: 21379

Here is the groovy script which can set the global property value.

Groovy Script

def newValue = 'testsetvalue'
//set the value to global property called PROPERTY_NAME
com.eviware.soapui.SoapUI.globalProperties.setPropertyValue('PROPERTY_NAME', newValue)
// get the property value which was set above.
def getNewValue = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue('PROPERTY_NAME')
//assert it
assert getNewValue == newValue

Upvotes: 2

Related Questions