Incorrect parameter value in request in runner

When I use pre-defined variables in request body value of parameter in request in runner is incorrect :open_mouth:

I am attaching screenshots to explain.
variable in body:


Request and Response in Runner:

logs:

Why is it? Why value in request does not match the actual sent value? It restarts the variable generation?
Is it a bug?

This will be down to the specific API. The API will determine what is returned.

Do you have documentation for this API?

Is it an in-house developed API, or it looks like a faker\mock library.

If its a fake\mock library. What are the matching rules that define what is returned?

As a test, change the dynamic variable to something static. You could use ā€œinterfaceā€ again, and see what is returned. I suspect it will be the same, so the problem isnā€™t with the dynamic variable.

to illustrate this case, I took this API
https://fakerestapi.azurewebsites.net/index.html
but I noticed the same behavior when working with my API

When I use static value it is correct


But if I use any random value, when I run request by Runner, it show incorrect Request value


By looking at the console logs. In the second screenshot, it appears that ā€œmobileā€ was sent instead of ā€œvirtualā€. The console log is probably going to be king here.

Can you clear the console logs, and run a single request (not via the runner) and then check the console log for the request and response. Do they match?

Then use the collection runner and again check the console log to see what was sent and received, and then match against the collection runner logs.

It looks like the console log is showing the correct details, and the collection runner log is showing something else.

1 Like

https://jam.dev/c/175a84f4-4b86-4c48-8fa3-618b42fe37e5
I record screencast to show case

Oh, sorry, misunderstanding. There is two different request:

  1. From Runner to show incorrect value - ā€œvirtualā€. When value was ā€œonlineā€.
  2. From tab with Request to show that API works fine, console shows correct value that match the actual value - ā€œmobileā€.

It looks like when its run in the runner, the details in the console log are different to what is being recorded in the ā€œpersist detailsā€ screen.

The request and response in the console logs are consistent.

I donā€™t know why they are showing different details. I only noticed that you didnā€™t save the request before running it the final time.

When I didnā€™t choose ā€œPersist responses for a sessionā€, whatever values are different. But in this case I canā€™t see Request runner log, only Response that incorrect :melting_face:

Were you rerunning the runner, after making a change in the request tab?

Unless you save the changes in the request, the runner wonā€™t pick up that change and would still be using the old saved value.

Enabling the Autosave will help here:

1 Like

Yes, I always push Ctrl+S after make change. Otherwise the request would have remained static data (in this case, screencast may show)

But I tried Autosave and this solve the problem :open_mouth:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.