Forum Discussion
nmrao
9 years agoChampion Level 3
You need to show the response, then only some one will able to help you.
Anyway, check the below link and see if that helps.
http://stackoverflow.com/questions/37412281/script-assertion-to-get-token-and-set-it-as-http-header-to-the-next-test-step/37412910#37412910
Anyway, check the below link and see if that helps.
http://stackoverflow.com/questions/37412281/script-assertion-to-get-token-and-set-it-as-http-header-to-the-next-test-step/37412910#37412910
- Phreak9 years agoNew Contributor
Hey,
Thanks for the reply. The response is pretty basic... For example:
token.id=AQIC5wM2LY4Sfczq0L3wcE24BKuMEJ1cC5o/cQMCWGDV18A=@AAJTSQACMDIAAlMxAAIwMQ==#
I just need to remove the 'token.id=' so I can have a variable that contains the token as that token is needed in various ways as a part of my test plan.
- KarelHusa9 years agoChampion Level 1
Hi,
you can remove the prefix of the string e.g. this way:
def response = 'token.id=AQIC5wM2LY4Sfczq0L3wcE24BKuMEJ1cC5o/cQMCWGDV18A=@AAJTSQACMDIAAlMxAAIwMQ==#'
def content = response.substring(9)
println contentKarel
Related Content
- 5 years ago
Recent Discussions
- 2 hours ago
- 2 days ago
- 3 days ago