- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 10:10 AM
Hi Everyone, Ihave a test suite in the Global Scope but I need to change the whole test to another scope, for what I saw this would imply changing the XML for every step of every test into the test suite which is not very practical. Do you know if there is a way of doing this by scripting? I would really appreciate that, thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 12:15 PM
Hello,
You can do it via script yes, but you will need to go to each ATF table you want to copy and enable the option Can create on the table config to true (for each table required):
Then after doing it for all atf related tables, you can then switch to your scope. And go to background scripts make sure you run the script on the wanted scope, and you can just use something like :
var grSATS = new GlideRecord('sys_atf_test_suite');
if (grSATS.get('1106a3193b3902108b6c118aa4e45aca')) {
var newSuiteId = grSATS.insert(); // save this value to be used for other tables
}
// Then for each test (sys_atf_test) in the suite do an insert chaging the parent field to the value above
// Then for each step (sys_atf_step_list) in the test changing the field test to be the one inserted above
I hope it works.
Cheers
Diogo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 12:15 PM
Hello,
You can do it via script yes, but you will need to go to each ATF table you want to copy and enable the option Can create on the table config to true (for each table required):
Then after doing it for all atf related tables, you can then switch to your scope. And go to background scripts make sure you run the script on the wanted scope, and you can just use something like :
var grSATS = new GlideRecord('sys_atf_test_suite');
if (grSATS.get('1106a3193b3902108b6c118aa4e45aca')) {
var newSuiteId = grSATS.insert(); // save this value to be used for other tables
}
// Then for each test (sys_atf_test) in the suite do an insert chaging the parent field to the value above
// Then for each step (sys_atf_step_list) in the test changing the field test to be the one inserted above
I hope it works.
Cheers
Diogo