Inside ATF, is it possible to get a record count?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 10:10 AM
I am wondering if there is a way to get a record count inside an ATF test.
My situation: my test is placing a catalog order through the Service Portal. I can see the REQ that was created, and the RITM as well, using "Record Query" test step. After the RITM is approved, the item I am requesting should create two SCTASK records.
Right now I just want to confirm that both SCTASKs are created. I've been looking through the docs, and have not yet found anything beyond Record Query, which tells me that at least one task was made. Is there a way to validate that 2 tasks were generated? Not just "at least one"?
Thanks
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 10:44 AM
Hi,
Did you try with the scripting? Glide SC Task table with the proper query and validate that there is 2 records.
Kindly mark my answer as Correct and helpful based on the Impact.
Regards,
Alok

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 10:47 AM
Hi,
You need to run the Service Side Script and then use the result from this script in next step to check if the count is 2 or more.
Check this below Variable which is available to next steps :
Example:
// outputs: Pre-defined Step config Output variables to set on this step during
// execution that are available to later steps
//
// Test step 1 - add data
// var gr = new GlideRecord('sc_task');
// // this sample step's Step config has Output variables named table and record_id
// outputs.table = 'sc_task';
// outputs.record_id = gr.insert();
So outputs.table and outputs.record_id can be used in next steps you want to.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 08:27 AM
Thank you both! Marking both as "Helpful", and when I am allowed to touch JavaScript to apply your suggestions I will also mark as Correct Answer.