Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

API has JSON parse issue due to searchsn text


#1

I am using the Test Rail API and Java to write some automatic result posting functionality for our automation runs. However when I perform a simple “get_projects” call, the JSON object that is returned comes back with a little extra piece to it.

For some reason instead of starting with what I would expect [{“id”:8,“name”:"Chris…

Instead it returns like this: searchsn[{“id”:8,“name”:"Chris…

Any idea what might cause this extra add on?

Thanks,
Chris


#2

Hello there,

Are you using a TestRail Server instance? If so, it’s likely that this extra string is included in your config.php file or any other custom file your team might have edited (translation, custom defect plugin etc.). The server would always return this in addition to the actual TestRail result then. You would see the same string in the HTML files TestRail returns then. Could you check the config.php file please? The file should not end with a ?>, but the PHP tag should not be closed. And the first characters in the file need to be <?php .

I hope this helps! You can also send us an email at contact@gurock.com to further troubleshoot this.


#3

Yes, we have our own instance here on site. I will check with the system administrator and let you know if this is the root cause. Thanks for the reply!! :smile:


#4

That was it! Our files have been updated and everything is returning properly now. Thanks for the help!!


#5

That’s great to hear and thanks for the update!

Regards,
Tobias