Jump to content
WAPT Forum
Sign in to follow this  
Guest brod

json parameters

Recommended Posts

Guest brod

I have a service that I am trying to test which takes JSOn via a POST and returns JSON. I am able to successfully record the POST however my attempts at changing the values using parameters have not worked. I edited the POST text and changed a value to $Var(UserName) and setup the parameter named something in the Response tab as being a random alpahanumeric string between 8 and 20 characters. When I run the tests the JSON get's posted however the $Var(UserName) comes through as blank. I also tried using url parameters and JSO Text parameters.

 

Can you please tell me the correct way to replace text in the posted json?

json post 1.wpp

Share this post


Link to post
Share on other sites

You can use a variable only in the following after initialization requests. If you want to use a variable in the first request you should create it in Initial variables of profile properties.

Share this post


Link to post
Share on other sites
Guest brod

Can you please give me an example on how to do that? I'm not sure that I understand. Would it be possible to change the file I uploaded so that it does what you are saying?

Share this post


Link to post
Share on other sites

Can you please give me an example on how to do that? I'm not sure that I understand. Would it be possible to change the file I uploaded so that it does what you are saying?

 

I've attached an example.

json post 1.wpp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×