Help in my code =/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help in my code =/

Lionel Blanco
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:
2.jpg

GET RESPONSE BODY CODE:
3.jpg

SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:
4.jpg

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


Regards.

Lionel Blanco
QA Automation

Reply | Threaded
Open this post in threaded view
|

Re: Help in my code =/

Amit Dhumal
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 <[hidden email]> 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:
2.jpg

GET RESPONSE BODY CODE:
3.jpg

SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:
4.jpg

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


Regards.

Lionel Blanco
QA Automation



--
Thanks & Regards,
Amit Dhumal
Reply | Threaded
Open this post in threaded view
|

Re: Help in my code =/

sbos-61
In reply to this post by Lionel Blanco
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 <[hidden email]> 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:
2.jpg

GET RESPONSE BODY CODE:
3.jpg

SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:
4.jpg

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


Regards.

Lionel Blanco
QA Automation

Reply | Threaded
Open this post in threaded view
|

Re: Help in my code =/

Lionel Blanco

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 (<[hidden email]>) 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 <[hidden email]> 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:
2.jpg

GET RESPONSE BODY CODE:
3.jpg

SAVE REQUEST BODY AND RESPONSE BODY IN XML CODE:
4.jpg

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


Regards.

Lionel Blanco
QA Automation