ATF - Running report and validating records

Community Alums
Not applicable

Is this possible to run a report and validating the record from ATF?

1 ACCEPTED SOLUTION

@Ganesh Manasali 

Yes, you can configure scheduled report in your instance and then run this scheduled report using

Server Side ATF Script

Sample script below

(function(outputs, steps, stepResult, assertEqual) {
// add test script here

var rec = new GlideRecord('sysauto_report'); 

rec.get('name', 'ReportName'); 

gs.executeNow(rec);

stepResult.setOutputMessage('Ran the Report');

stepResult.setSuccess();

return true;

})(outputs, steps, stepResult, assertEqual);

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

bbf3562
Kilo Guru

Hi Ganesh,

Yes ATF can validate any record using "Record Validation" step to validate specific record in the specific table you selected.

Can you explain a bit more about what report for ATF to run?

 

Please click helpful or solved if that answered your question.

Community Alums
Not applicable

Hello,

1) I have a report called Active Incidents. I want to run this report from ATF.

2) I have given filter condition like "Active is True", after running the report, ATF should validate all the records which are matching the filter condition of the report.

Please provide your suggestion on this. Thank You for the reply!

@Ganesh Manasali 

Yes, you can configure scheduled report in your instance and then run this scheduled report using

Server Side ATF Script

Sample script below

(function(outputs, steps, stepResult, assertEqual) {
// add test script here

var rec = new GlideRecord('sysauto_report'); 

rec.get('name', 'ReportName'); 

gs.executeNow(rec);

stepResult.setOutputMessage('Ran the Report');

stepResult.setSuccess();

return true;

})(outputs, steps, stepResult, assertEqual);

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ganesh Manasali 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader