Forum Discussion
Does the accessToken value need to be entered as part of the request XML or as one of the soapui properties?
If it needs to be part of the XML, are you not able to pass a tokenised value through i.e.
<Test>${Login 1 - Portal Login#Request#//accessToken[1]}</Test>
For example purposes:
My Login 1 - Portal Login request looks like this:
<accessToken>1234</accessToken>
so the Test element should be replaced with 1234 upon executing the second request.
simonjdonnelly wrote:Does the accessToken value need to be entered as part of the request XML or as one of the soapui properties?
If it needs to be part of the XML, are you not able to pass a tokenised value through i.e.
<Test>${Login 1 - Portal Login#Request#//accessToken[1]}</Test>
For example purposes:
My Login 1 - Portal Login request looks like this:
<accessToken>1234</accessToken>
so the Test element should be replaced with 1234 upon executing the second request.
simonjdonnellythe response
of the first request is this:
I need to have the value for accesstoken be pasted in subsequent requests. But I can't do it using Property Transfer.
- simonjdonnelly8 years agoContributor
Passing the value through as a parameterised version should work then:
I don't have any sample REST JSON services to hand, so I've used soap but it shouldn't be too different:
Place ${Login 1 - Portal Login#Request#//Response[1]/accessToken[1]} in the second request, where you want the access token previously generated to appear.
This will take the value from the test step named 'Login 1 - Portal Login' and take the accessToken from the structure Response > accessToken.
- mgroen28 years agoSuper Contributor
simonjdonnelly wrote:Passing the value through as a parameterised version should work then:
I don't have any sample REST JSON services to hand, so I've used soap but it shouldn't be too different:
Place ${Login 1 - Portal Login#Request#//Response[1]/accessToken[1]} in the second request, where you want the access token previously generated to appear.
This will take the value from the test step named 'Login 1 - Portal Login' and take the accessToken from the structure Response > accessToken.
I have tried it with SessionId, but it doesn't work.
The sessionId is not being captured and remains hardcoded in the header (instead of taking over the value of the sessionId);
any tips?
- simonjdonnelly8 years agoContributor
You are missing the opening curly brace below: $Nameanddestinationcoding#Request#//Response[1]/SessionId[1]}
Try it with the brace: ${Nameanddestinationcoding#Request#//Response[1]/SessionId[1]}
This should work
If it doesn't, Groovy scripting might be the work around
Related Content
Recent Discussions
- 15 years ago