Hi,
i have a synthetic test with POST method which creates an account.
i save the account_id in a global variable with this line:
var reponseBody = response.getResponseBody();
var jsonData = JSON.parse(responseBody);
api.setValue(“account_id”, jsonData.id)
Then i have a second test with GET method, here i need to construct the url by appending the account_id:
this is what i did:
In the first field for http request url i write this:
https://myapp.test.api/create_accout/{account_id}
HTTP method = GET
pre-execution script is enabled and i wrote this:
var account_id = api.getValue(“account_id”);
var url = request.getUrl();
url = url.replace(“{account_id}”, account_id);
request.setUrl(url);
When i execute the first test it works well, it creates the account and i save the account_id in a global variable.
When i execute the second test, it returns UNKNOWN_METHOD_ERROR
if i check the error, the request is not sent, the url is empty.
Any help please, this is the first time i’m using dynatrace for synthetic test.
Thank you