cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Validate the content of the JSON response in HTTP synthetic monitoring for an API.

Sisapy09
Contributor

How can I validate a JSON response in the HTTP monitor? I only need to check if the JSON contains a key with the text "xyz". The executions are failing when I run the monitor with content validation. Additionally, the page redirects to an SSO login page and asks for a password. Do I need to make any changes to address this?

1 REPLY 1

p_devulapalli
Champion

@Sisapy09 - One way to achieving it is by creating multiple HTTP requests in the HTTP monitor. First one would be for authentication which includes the URL and authentication and the second request would be to query the response and validate , you can use the scripts to retrieve the content and validate.

https://docs.dynatrace.com/docs/shortlink/http-monitors-config#http-requests

https://docs.dynatrace.com/docs/shortlink/http-monitor-pre-post-script

 

Phani Devulapalli

Featured Posts