WAPT Forum: JSON Parameters - WAPT Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

JSON Parameters How to use variables with JSON requests?

#1 User is offline   RobertNegrete 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 17-August 09

  Posted 17 August 2009 - 06:42 PM

Hi,

I'm trying to make an scenario at a web application that uses a lot of json, my first challenge was to make a list of parameters for codes, an then use the selected code an pass it to the next step, however I can't do that. Can you help me pls?

Here I will try to explain how I'm doing:

Step 6:

parameters

parameter_name: obj
parameter_value: $LRand({"hotelCode":"FIN","languaje":"es"},{"hotelCode":"ECA","languaje":"es"})

variables
variable_name: hotel
variable_value: $Search({"hotelCode":",",,0)

Step 7:
I try to use the variable "hotel"
{"hotelCode":$Var(hotel),"languageCode":"es","posCode":"CRMX"}


and finally I run the test...

at the logs I found the same: {"hotelCode":$Var(hotel),"languageCode":"es","posCode":"CRMX"} and I expected {"hotelCode":"ECA","languageCode":"es","posCode":"CRMX"} or {"hotelCode":"FIN","languageCode":"es","posCode":"CRMX"}

Probably I'm missundersanding the parametrization examples.

Please can you help me.

Regards.
0

#2 User is offline   aczuczor 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 23-August 11

Posted 23 August 2011 - 01:52 PM

View PostRobertNegrete, on 17 August 2009 - 06:42 PM, said:

Hi,

I'm trying to make an scenario at a web application that uses a lot of json, my first challenge was to make a list of parameters for codes, an then use the selected code an pass it to the next step, however I can't do that. Can you help me pls?

Here I will try to explain how I'm doing:

Step 6:

parameters

parameter_name: obj
parameter_value: $LRand({"hotelCode":"FIN","languaje":"es"},{"hotelCode":"ECA","languaje":"es"})

variables
variable_name: hotel
variable_value: $Search({"hotelCode":",",,0)

Step 7:
I try to use the variable "hotel"
{"hotelCode":$Var(hotel),"languageCode":"es","posCode":"CRMX"}


and finally I run the test...

at the logs I found the same: {"hotelCode":$Var(hotel),"languageCode":"es","posCode":"CRMX"} and I expected {"hotelCode":"ECA","languageCode":"es","posCode":"CRMX"} or {"hotelCode":"FIN","languageCode":"es","posCode":"CRMX"}

Probably I'm missundersanding the parametrization examples.

Please can you help me.

Regards.

0

#3 User is offline   aczuczor 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 23-August 11

Posted 23 August 2011 - 01:58 PM

Dear All,

i have the same problem. I would like to generate custom JSON request with variable but i did not find any information how should i realize that.

Can you please help me or send an example?

Thank you
0

#4 User is offline   Sergei Leonov 

  • Advanced Member
  • PipPipPip
  • Group: Administrators
  • Posts: 373
  • Joined: 12-February 08

Posted 25 August 2011 - 08:56 AM

WAPT can recognize JSON requests if JSON module is installed. You can use variables into JSON requests.
Sergei Leonov
WAPT Project Manager
SoftLogica LLC

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users