Forum Discussion

Terkon's avatar
Terkon
Contributor
5 years ago

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": ""
}
}

 

 

  • 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

  • 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