Ask a Question

REST calls do not work with Load agents: invalid JSON

SOLVED
Terkon
Contributor

REST calls do not work with Load agents: invalid JSON

 

Hi!
I have my testcases with REST calls which work perfect when I run them locally.

 

But when I let them run by load agents I get a lot of http 500 errors.

The webserver shows

 

cnqq2wfzbrywrx304vgetyhy [39] FATAL Global - (153) 1> Exception: Invalid JSON primitive: .

 

Tthe dot is given by the webserver, not typed by me.

 

Anyone any idea about this?

 

Unfortunately I do not find a way to get a raw request when the load agents are running, I only can give a raw by executing the testcase manually.

 

Thx πŸ™‚

 

 

POST https://myURL.com/en/ShoppingCart/AddToCart HTTP/1.1
Accept-Encoding: gzip,deflate
x-requested-with: XMLHttpRequest
Content-Type: application/json
cookie: ASP.NET_SessionId=4q0m1klo5zuxehm532i1552q
Content-Length: 212
Host: myURL.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/12.0.1)

{
"model": {
"Date": "2020-09-24",
"TicketTypeId": 275,
"ProjNr": 995,
"PoolNr": 1,
"PersonTypes[0].PersonTypeId": 70,
"PersonTypes[0].Quantity": 1,
"PersonTypes[0].Tariff.ExtMaterialNr": ""
}
}

 

 

3 REPLIES 3
sonya_m
SmartBear Alumni (Retired)

Thanks for your question @Terkon !

 

Any ideas what can be done here @nmrao @richie @avidCoder?


Sonya Mihaljova
Community and Education Specialist

Terkon
Contributor

I turned this to support.

Thx

Terkon
Contributor

Found the problem:
- one property I used in the Login turned out to be empty sometimes - I am still wondering how it worked without locally, without Loadagent

- then also, there were some empty values when the datasource (jdbc) ran out of data and did not restart it. I has to check in the datasource checkbox "Skip loop on empty" in the options

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β