18 Aug 2021 04:52 PM - last edited on 07 Sep 2021 03:17 PM by MaciejNeumann
Hi guys
We have private location site and an http check running on it with no problems.
Once we added a validation text
as can be seen from postman running on the same machine
test is falling on this validation.
This script is running with credentials so when looking on successful test response body is missing
Can it be that the response body is empty for validation text?
We have tried to print in the post exestuation step the response body
but we didn't find it in any of the logs on this AG.
Any suggestion will be more than appreciated here
Thanks in advance and stay safe
Yos
Solved! Go to Solution.
18 Aug 2021 06:55 PM - edited 18 Aug 2021 07:40 PM
Hello,
The response validation does search for the text within the response body - so if the response body isn't returning anything then that would be why. Are you able to double check that the HTTP Request is correct and should return a response body?
More information can be found here: https://www.dynatrace.com/support/help/shortlink/http-monitors-config#anchor-http-additional-options
18 Aug 2021 07:18 PM
Hi @ryan_ott ,thanks for your reply!
Yep we already check documentation regarding http text validation and know that it checking the response body, that's the reason we have opened this thread.
From postman its look like the response body do present.
From dynatrace UI the response body shows as "" because this http check runs with credentials.
So question here if that is an issue with the credential or some other issue.
Unfurtantlly we cannot run this check without credentials.
We have tried to print the value of the body in post exaction phase we didn't find it in any log.
Yos
20 Aug 2021 08:35 AM
Hi Yos,
I tested using credentials in an HTTP Monitor and then using text validation on the response and was able to confirm that this does work in a simple example. I also piped the the responseBody to the vuc-http-custom.log using api.info in the post-execution script like this:
var responseBod = response.getResponseBody();
api.info("responseBody: " + responseBod);
Best wishes, Hannah
21 Aug 2021 08:20 AM
Hi @HannahM Thanks for your tests and update
I also was able to succeed and use the text validation with credentials vault in test env.
Will give it another try with in customer env next week, and will update.
Thanks for pointing where to look for the output of api.info - it will be good to add this information to documentation.
All the best and stay safe
Yos
23 Aug 2021 01:44 PM
Hi @HannahM
Now that I found in vuc-http-custom.log the api.info() messages I was able to discovered why the validation was failing in the first place.
Thanks a lot
Yos
23 Aug 2021 01:45 PM
That's excellent news. We'll make sure the docs get updated. Thanks for the prompt.