You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Lionel Blanco <ml...@gmail.com> on 2020/08/15 17:15:32 UTC

Help in my code =/

Hello, please I need help in the following scenario:

In my project I have the following request;

Register User  ${__time(dd-MM-YY / HH.mm)}hs* (Register a user)*
Check customer data*  (Check the data of that previously registered user)*
Execute Operator Provisioning Product *(Subscribe and confirm subscription
to the previously registered user )*

What they ask me is to save the complete Request body data and response
data of each execution. So far so good, I managed to do it, but with a
problem;

The Request Execute Operator Provisioning Product is inside a loop
controller (5), that is, it executes the request Execute Operator
Provisioning Product 5 times, and I need to save the 5 Request Body data
and the 5 response data but it is only saving the last one, it overwrites
each run and save the last one.
How should I modify my code so that it saves the complete 5 requests?
Next I show my code;

*GET REQUEST BODY CODE:*
[image: 2.jpg]

*GET RESPONSE BODY CODE:*
[image: 3.jpg]

*SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:*
[image: 4.jpg]

*ARCHIVE XML : Save only the last execution of the loop. Not 5*


Regards.

Lionel Blanco
QA Automation

Re: Help in my code =/

Posted by Lionel Blanco <ml...@gmail.com>.
Hi,

The solution was:

 just move the "Save response..." controller inside the loop, immediately
after the samplers.
Sergio Boso.

Thank you very much to all.


El sáb., 15 ago. 2020 a las 16:42, Sergio Boso (<se...@bosoconsulting.it>)
escribió:

> Hi,
>  just move the "Save response..." controller inside the loop, immediately
> after the samplers.
>
> Regards
> Sergio Boso
>
>
> Il Sab 15 Ago 2020, 19:16 Lionel Blanco <ml...@gmail.com> ha
> scritto:
>
>> Hello, please I need help in the following scenario:
>>
>> In my project I have the following request;
>>
>> Register User  ${__time(dd-MM-YY / HH.mm)}hs* (Register a user)*
>> Check customer data*  (Check the data of that previously registered
>> user)*
>> Execute Operator Provisioning Product *(Subscribe and confirm
>> subscription to the previously registered user )*
>>
>> What they ask me is to save the complete Request body data and response
>> data of each execution. So far so good, I managed to do it, but with a
>> problem;
>>
>> The Request Execute Operator Provisioning Product is inside a loop
>> controller (5), that is, it executes the request Execute Operator
>> Provisioning Product 5 times, and I need to save the 5 Request Body data
>> and the 5 response data but it is only saving the last one, it overwrites
>> each run and save the last one.
>> How should I modify my code so that it saves the complete 5 requests?
>> Next I show my code;
>>
>> *GET REQUEST BODY CODE:*
>> [image: 2.jpg]
>>
>> *GET RESPONSE BODY CODE:*
>> [image: 3.jpg]
>>
>> *SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:*
>> [image: 4.jpg]
>>
>> *ARCHIVE XML : Save only the last execution of the loop. Not 5*
>>
>>
>> Regards.
>>
>> Lionel Blanco
>> QA Automation
>>
>>

Re: Help in my code =/

Posted by Sergio Boso <se...@bosoconsulting.it>.
Hi,
 just move the "Save response..." controller inside the loop, immediately
after the samplers.

Regards
Sergio Boso


Il Sab 15 Ago 2020, 19:16 Lionel Blanco <ml...@gmail.com> ha
scritto:

> Hello, please I need help in the following scenario:
>
> In my project I have the following request;
>
> Register User  ${__time(dd-MM-YY / HH.mm)}hs* (Register a user)*
> Check customer data*  (Check the data of that previously registered user)*
> Execute Operator Provisioning Product *(Subscribe and confirm
> subscription to the previously registered user )*
>
> What they ask me is to save the complete Request body data and response
> data of each execution. So far so good, I managed to do it, but with a
> problem;
>
> The Request Execute Operator Provisioning Product is inside a loop
> controller (5), that is, it executes the request Execute Operator
> Provisioning Product 5 times, and I need to save the 5 Request Body data
> and the 5 response data but it is only saving the last one, it overwrites
> each run and save the last one.
> How should I modify my code so that it saves the complete 5 requests?
> Next I show my code;
>
> *GET REQUEST BODY CODE:*
> [image: 2.jpg]
>
> *GET RESPONSE BODY CODE:*
> [image: 3.jpg]
>
> *SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:*
> [image: 4.jpg]
>
> *ARCHIVE XML : Save only the last execution of the loop. Not 5*
>
>
> Regards.
>
> Lionel Blanco
> QA Automation
>
>

Re: Help in my code =/

Posted by Amit Dhumal <am...@gmail.com>.
As far as I understood from your custom code you are putting value in a
dictionary like variable 'vars' and it has the property to override
existing value.
(1) Please check prior putting value whether any value is associated with
key requestProvisioning
(2) If available then extract it first. And now append a new value to the
existing one.
     NOTE: You can use list to maintain multiple data entities

On Sat, Aug 15, 2020 at 10:46 PM Lionel Blanco <ml...@gmail.com>
wrote:

> Hello, please I need help in the following scenario:
>
> In my project I have the following request;
>
> Register User  ${__time(dd-MM-YY / HH.mm)}hs* (Register a user)*
> Check customer data*  (Check the data of that previously registered user)*
> Execute Operator Provisioning Product *(Subscribe and confirm
> subscription to the previously registered user )*
>
> What they ask me is to save the complete Request body data and response
> data of each execution. So far so good, I managed to do it, but with a
> problem;
>
> The Request Execute Operator Provisioning Product is inside a loop
> controller (5), that is, it executes the request Execute Operator
> Provisioning Product 5 times, and I need to save the 5 Request Body data
> and the 5 response data but it is only saving the last one, it overwrites
> each run and save the last one.
> How should I modify my code so that it saves the complete 5 requests?
> Next I show my code;
>
> *GET REQUEST BODY CODE:*
> [image: 2.jpg]
>
> *GET RESPONSE BODY CODE:*
> [image: 3.jpg]
>
> *SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:*
> [image: 4.jpg]
>
> *ARCHIVE XML : Save only the last execution of the loop. Not 5*
>
>
> Regards.
>
> Lionel Blanco
> QA Automation
>
>

-- 
Thanks & Regards,
Amit Dhumal