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

Dynatrace Synthetic pre-post scripting

dannemca
DynaMight Guru
DynaMight Guru

Hi all.

I need to create a Dynatrace Synthetic monitor to perform two requests, a POST and then a GET.
Inside the POST "requestBody" I need to pass an INT value, maybe using the api.randomNextInt().
Then the GET request need to use the same INT value generated to validate the response, to pass if present, into validation - rules - value field.
Is this possible? To use the variables into the POST requestbody, and on GET validation?
Can someone help me to set up this script properly?

Thanks.

Site Reliability Engineer @ Kyndryl
1 REPLY 1

skrystosik
DynaMight Guru
DynaMight Guru

Here you have some info about passing variables. When you set one on request 1, you should be able to use it in request 2:

https://www.dynatrace.com/support/help/shortlink/http-monitor-pre-post-script#passing-variables

Sebastian

Regards, Sebastian

Featured Posts