POST Request only receiving part of the expected response

I am currently trying to automate the process of testing our API functions through data driven testing. The values for each POST request are time sensitive so they are calculated during run time. I have been passing the values through to the request as seen below in request2 but I am only receiving part of the correct response. However when I pass physical values to the request as seen with request3 I receive the complete response.

The weird part is that the response for request2 is correct it just cuts off a large chunk in the middle of the response (it only gives what is beneath the first header and the last header in the xml response). I tried to change the ResponseObject size but that didn’t make a change. Below is the requests being made in the test case and a copy of the Event Log after running the test case. Requests 2-6 should all do the same thing but only response3 gives the complete response. All others give the same partial response.

I am currently using Katalon Studios version 6.2.1

Event Log:

Warning: NLS missing message: MSG_FORUM_SEARCH in: com.kms.katalon.constants.messages
Warning: NLS unused message: MENU_CONTEXT_WEBSERVICE_REQ_POSTMAN in: com.kms.katalon.composer.webservice.constants.composerWebserviceMessages
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See SLF4J Error Codes for further details.
Launcher status after execution process completed: Running
Launcher status after execution process completed: Running
Expected an instance of ReferenceBinding but got: org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
Expected an instance of ReferenceBinding but got: org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
Launcher status after execution process completed: Running
Launcher status after execution process completed: Running

Hi @Daniella.Turbessi,
Can you provide your test object file?

I am not using a Test Object but I am sending a POST request. Are you asking for the RS file for the request?

Hi @Daniella.Turbessi,
Yes, please share the rs file

Here it is. And thank you for the quick response. Retrieve Candidate Results Request RS File.zip (1.3 KB)

@Daniella.Turbessi,
Did you try to send the request from the request object UI? Did you achieve the whole response?

Yes I did and there I achieved the whole response as well when manually putting the values for the variables.

It worked that way however I can’t automate the api calls without passing in values to the request

Hi @Daniella.Turbessi,
When you sent your request with request object UI, did you receive the whole response for the case no variable is supplied?

@huynguyen
For the case of response3 in the file attached I did receive the entire response (which does not pass any variables but the exact values needed). When I send the request without any variable values at all I get an error response from our API saying there is missing information from the request which is the correct response.

I just noticed also that when I create String variables and just set them to the exact value and pass them through the request object the entire response is given.

Hi @Daniella.Turbessi,
Can you send me the whole project? You can send via email directly in this forum. I promise to keep all your project information confidential.
Regards.

Hi @Daniella.Turbessi

What is value of variable “TimeDate2” and what is value of variable “TimeDate”. You use two variables, maybe their values are different or incorrect (the DateTime format may be incorrect).

I met with the situation when server would send part of response. This part was what server built before a server-side error occurred. The error was caused by incorrect data sent to the server.

Check data and server logs.

@huynguyen I am sorry but I cannot disclose the code of this project.
@Igi_PL
I have been trying different ways of passing the variables in and when I copy the variables that I’m calculating and paste them in to the request I get the entire response I am looking for. However passing them through automatically after they have been calculated only gives me a partial response. I believe this is a formatting error but I know that what I am passing through is formatted correctly. The only thing I could think of is if a string is being stored differently in the two cases (one a literal string and the other calculate). Does Katalon store strings differently depending on whether or not it’s a literal string when initialized?

You can check formatting:
WebUI.comment(TimeDate)
If this return error try
WebUI.comment(TimeDate as String)

Just check data formatting and make sure thet you send correct data type and format.