18 Jun 2024 04:07 PM
Hi All - we need to generate a reconcilation report everyday.
for ex: App --> create recon report --> "Myreconreportname" . so , i have created a Synthetic check to record the session.
for the first attempt, when i do "record Clickpath" it was successful, when i schedule this synthetic check to run every 1 day, Synthetic check got failed saying "Myreconreportname" already exist.
Script i see in the synthetic recorder is:
"description": " keystrokes on \"txtReconReportName\"",
"textvalue":"Myreconreportname"
i want to add timestamp along with Myreconreportname so that my synthetic check will succeed everyday.
Appreciate if i can get some solution to this
Solved! Go to Solution.
18 Jun 2024 04:48 PM
You will need to use a JavaScript event to generate the report name.
var todayDate = new Date();
var reportName = "Myreconreportname" + todayDate;
api.setValue("reportName", reportName);
you can then use the placeholder {reportName} for the Keystroke value
19 Jun 2024 02:57 PM - edited 19 Jun 2024 03:01 PM
Hi @HannahM - Thanks for the reply,
Where can i use the sample script shared by you?
var todayDate = new Date(); var reportName = "Myreconreportname" + todayDate; api.setValue("reportName", reportName);
My Code is looks like below:
{ "Type" : "keystrokes",
"target": {
"locators": [{
"type": "css",
"value": "#txtReconReportName"
},{
"type": "css",
"value": ".form-control:eq(0)"
},{
"type": "css",
"value": "#txtReconReportName"
},{
"type": "css",
"value": "input[type=\"text\"][id=\"txtReconReportName"]"
}]
},
"masked" : false,
"SimulateBlurEvent" : true,
"description":"Keystroke on \#txtReconReportName\""
"textvalue": "{ReportName}" -- Placeholder as suggested by you
19 Jun 2024 03:24 PM
The snippet should go in a new JavaScript event which you add prior to the Keystrokes event.
19 Jun 2024 04:28 PM
Thanks @HannahM it worked.