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

Dynamic text input on synthetic monitor


hello, can we do something like this? In the clickpath section of the synthetic browser Can we dynamically query the PNR number when doing online check-in? For example, we want to take the PNR numbers from file and add them to the field as in the figure.



I hope I was able to explain. Can I pull the data from a file in the Clickpath section and do this with a script? Thanks.



DynaMight Guru
DynaMight Guru


I would say yes if you that file is reachable. It means, if you can make a JavaScript code to reach content in that file, and paste it in that field.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Do you have a sample of the Java Script code I can test?

Dynatrace Leader
Dynatrace Leader

How is the file getting updated? Is it another monitor that is creating the booking reference and this one does something with it? If that's the case, you might be better using the Credential Vault. So the first monitor could create the PNR and use the Credential Vault API to update an existing credential, and then the 2nd monitor can just reference it. 

Synthetic SME and community advocate.

Do you have an example?

In the first script, store the PNR value in a Credential Vault entry. CREDENTIALS_VAULT-xxx is the credential vault entry where you are storing the PNR, CREDENTIALS_VAULT-yyy is the token needed to update the crdential vault entry. 

var PNR = yourPNRvalue;
url = '';
pdata = '{  "name": "YourCredentialName",  "type": "TOKEN",  "token": "' + PNR + '"}';;
fetch(url, {
        method: 'put',
        body: pdata,
        headers: {
            'accept': 'application/json; charset=utf-8',
            'Content-Type': 'application/json; charset=utf-8',
            'Authorization': 'Api-Token ' + api.getCredential("CREDENTIALS_VAULT-yyy", "token")
    }).then(function(res) {
        ResponseCode = res.status;"responseCode = " + ResponseCode);
        return res.text();
    .then(function(data) {

        if (ResponseCode == 204) {

        } else {
  'Update failed: ' + ResponseCode);
    .catch(e =>;

Then in the  second script you can retrieve the PNR and set a variable with it to be used elsewhere in the script

var PNR = api.getCredential("CREDENTIALS_VAULT-xxx", "token");

api.setValue("PNR", PNR);
Synthetic SME and community advocate.

@Mustafa_ERZURUM did it help you?

When passion meets people magic and innovation happen.

Featured Posts