- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 06:48 PM
I want to create a lot of records using ATF. Is it possible to read the value set in Test Step from an external file?
Since the value set in the record changes depending on the user, I am thinking of creating a setting file as an external file for each user.
Thanks,
Shogo
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 09:49 PM
Hi,
I doubt this can be done using ATF.
There is no step where you can upload file and read it's contents
You can try to use Server Side Script step for this but I doubt if it will be helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 09:49 PM
Hi,
I doubt this can be done using ATF.
There is no step where you can upload file and read it's contents
You can try to use Server Side Script step for this but I doubt if it will be helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 11:21 PM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 11:54 PM
It is possible to create a test matrix using Excel, and cause an ATF test to run for each row in the spreadsheet.
This is done by using shared parameters. The first step is to add columns to the table Test Run Data Set (sys_atf_parameter_set). If you create a shared parameter, the system will automatically add a column to sys_atf_parameter_set. Or you can add the columns manually. You will need a column in sys_atf_parameter_set for each column in your spreadsheet which you are using in your test.
You will need two additional columns in your spreadsheet: test name and order. These will be the coalesce values when you import from the spreadsheet. Make sure that each row in your spreadsheet has a unique order number.
When you create your Test, be sure to check the box for "Enable parameterized testing".
Next you will need to create a transform map to load the data into sys_atf_parameter_set from your spreadsheet. You will coalesce on test name and order.
After you have run the transform, you will see all the imported rows appear in the Test Run Data Sets tab on your test. You should have a Test Run Data Set row for each row in your spreadsheet.
These parameter values can be referenced from within your Test.
If the test data changes, then delete all the Test Run Data Set rows, and re-import from Excel.
The limitation of this model is that, if your are running lots of different kinds of tests, then you need to keep adding columns to sys_atf_parameter_set. However, if you only need a few variables such as user, location and configuration item, then it works pretty well.