Forum Discussion
nmrao
10 years agoCommunity Hero
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
- Phreak10 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.
- KarelHusa10 years agoSuper Contributor
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