Forum Discussion
- khelfrich23New Member
Hi armygrad,
try to use json.tokenData.access_token to get the token string and put it in Property variable:
testSuite.setPropertyValue("myToken", json.tokenData.access_token); //in a defined Property myTokenkhelfrich23
- armygradContributor
Thanks for replying would be from a property transfer test step?
- jkrolczyRegular Contributor
By different ways to extract the token value from your response.
If you can isolate that value into a variable, then you could use the following code example.Use Groovy script step here.
** Note: tokenID is my custom project properties
def tokenid = extractedValue2
log.info(" Token value: "+tokenid);testRunner.testCase.testSuite.project.setPropertyValue( "tokenID", tokenid );
Global variable syntax shown below.
Very useful webpage:
https://www.softwaretestinghelp.com/soapui-tutorial-7-properties-in-soapui-groovy-script/
These script lines are used to set the value to the local and global property.
testRunner.testCase.setPropertyValue( " LocalPropertyName ", someValue )
testRunner.testCase.testSuite.setPropertyValue( " LocalPropertyName ", someValue )
testRunner.testCase.testSuite.project.setPropertyValue( " LocalPropertyName ", someValue )
com.eviware.soapui.SoapUI.globalProperties.setPropertyValue
( " GlobalPropertyName ", someValue )- armygradContributor
Thanks for the link much appreciated
Related Content
- 2 years ago
- 3 years ago
Recent Discussions
- 2 days ago