Ask a Question

Transfer property value to request header in next step.

SOLVED
pablofuentesbod
Occasional Contributor

Transfer property value to request header in next step.

Hi all,

 

I'm trying to transfer one property from one test step response to next step request.

 

I have managed to extract the property in a property called myproperty but now I need to use this property in an authentication header but using $myproperty in header value the value is not correctly set during testing.

 

please can you help me to set the header with the property value.

 

thanks in advance, Pablo.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
nmrao
Community Hero

Re: Transfer property value to request header in next step.

Hmm, really frustrating for both.

 

Step1:

 

Select test case name, and select custom tab and add property as mentioned and leave value blank (a Property Transfer step is going to write value for this )

step1.png

 

Step 2 : Go to Property transfer step, make the changes as suggested in the image i.e., Select the test case for the target drop down and Select the Property name

 

transfer.JPG

 

Then remove the tem_property test step

 

Step 3:

 

config.JPG

 

 

 



Regards,
Rao.

View solution in original post

18 REPLIES 18
nmrao
Community Hero

Re: Transfer property value to request header in next step.

Not sure doing it thru Property Transfer. It can be done using Script Assertion.

 

If you provide the response of the first request step, and which value needs to be set as header, that would be helpful to offer any help.



Regards,
Rao.
pablofuentesbod
Occasional Contributor

Re: Transfer property value to request header in next step.

Hi rao,

 

thanks for the update.

 

I have never used scripts in soap iu .. planning to do using gui as relly straight forward but it in my case it does not work ... the authetification header is not replaced with the property value.

 

I'm trying to set the authetification header with the vakue if the property / response tag.

 

thanks for your help.

 

best regards, Pablo.

 

nmrao
Community Hero

Re: Transfer property value to request header in next step.

Hmm.. there seem to be otherway without script too.

Transfer the property to test case level, say DYNAMIC_AUTH as property name and store the value.

In the next request, add header with required header name and value as ${#TestCase#DYNAMIC_AUTH}

Hope the above should help.


Regards,
Rao.
pablofuentesbod
Occasional Contributor

Re: Transfer property value to request header in next step.

Hi Rao,

thanks so much for your help and support, really appreciated.

I have tried with the following value:

${#LoginStep#myproperty}

at authetification headers and the value is empty.

attached the config done and the test results where you can see that myproerty is correctly assigned but the auht header value no :-(.

any idea ???

best regards, Pablo.

 

 

 

 

nmrao
Community Hero

Re: Transfer property value to request header in next step.

You seemed to replace some value and created an addition properties step and both are not suggested. Just follow the previous reply as it is, no change ( or replace any values for test case)


Regards,
Rao.
pablofuentesbod
Occasional Contributor

Re: Transfer property value to request header in next step.

Hi rao,

 

thanks for your help.

 

I have only created a tranfer step and and a property to store the value, this seems to work fine.

 

On the other side only assiged the value as suggested (${#LoginStep#myproperty}).

 

Sorry bu I can not see extra steps in my project.

 

can you help me ??

 

best regards, pablo.

nmrao
Community Hero

Re: Transfer property value to request header in next step.

@pablofuentesbod,

 

I am reiterating that you do not need 3rd step (Properties) & just follow the instructions as it is mentioned in my 2nd reply.

 

Select the test case, In the below you see two tabs, select custom properties tab, add DYNAMIC_AUTH property and value is empty.

In the property transfer step, store the value at test case level for the above property.

In the next request, add the header; use the header name as needed and value as ${#TestCase#DYNAMIC_AUTH} (no replacement here, TestCase is predefined, you were replacing with your test case name from the screen shot, that is not suggested) 



Regards,
Rao.
pablofuentesbod
Occasional Contributor

Re: Transfer property value to request header in next step.

Hi rao,

 

thanks so much for your help and support, really appreciated.

 

followed the steps suggested and you can see that DYNAMIC_AUTH is set with original value but the header is empty:

 

GETxxxx/SecApi_v5/customers HTTP/1.1
Accept-Encoding: gzip,deflate
myheader:
Authorization:
Host: xxxx:8001
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

 

any ideas ??

 

best regards, Pablo.

 

 

 

 

nmrao
Community Hero

Re: Transfer property value to request header in next step.

@pablofuentesbod,
Please show the Property Transfer screen shot? Have you selected the Target as TestCase and DYNAMIC_AUTH?

Remove unwanted header myheader.
Otherwise, please show the response and what value do need to extract from it.


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: