简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM