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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...