I have a set of API tests which are failing on a Jenkins run via the MSTest runner plugin. On investigation, the exception message returned is the following
Status: BadRequest. Reason: {"Message":"The request is invalid."}
The encoded url is getting the %20 stripped from DateTime type'd parameters and the request url at this point now is attempting to post with spaces.
Example of query string /GenerateReport?startDate=09/05/2017 09:58:45&endDate=14/05/2017 09:58:45
If I run these tests directly from Visual Studio they pass and on capturing the post request, it is passed encoded as expected.
Anyone able to explain why this would be happening when executing these tests only via Jenkins/MSTest plugin? And if so, do you have a work around/config change available?
@Kobi - you were correct, sorry I haven't replied earlier.
I'm now parsing the
DateTimeparam with the culture specific format (CultureInfo.CurrentCulture). I hadn't also hadn't read your response properly, our development environment is on a US server and I'm UK based so that would be expected.Thank you.