
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 03:58 AM
Hi Everyone,
We have a requirement where we need to test a Standard change request validation through ServiceNow ATF.
We have followed the below link:
1. https://greg-grabowski.com/test-standard-change-automated-test-framework/
2.https://greg-grabowski.com/test-standard-change-automated-test-framework-part-2/.
The issues which we are facing is that the default value of the change request type is set to standard(by following the above link), so we couldn't able to perform other tests where we need to test other change types.
is there any workaround to test standard change request.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 01:15 AM
Hi Fedrick
You can use the query in the below format:
var standardTemplate = new GlideRecord('std_change_record_producer');
standardTemplate.addQuery('active', true);
//You can also add a query to get the required template
standardTemplate.query();
standardTemplate.next();
var gr = new GlideRecord('change_request');
gr.applyTemplate(String(standardTemplate.template.name)); //This step applies the queried template
gr.setValue('type', 'standard');
gr.setValue('short_description', 'This is my short descr');
var sysID = gr.insert();
--
Cheers
Ankush

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 08:11 AM
Hi
Can you please tell what other tests are not working fine? On other changes, you can select the type to 'Normal' or 'Emergency.
Another workaround to test standard change is just create it from 'Run Server Side Script' method.
--
Best Regards
Ankush

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 09:25 PM
Hi
yes , I can able to create test steps for "Normal change" by using 'open a new form' on "Change Request" Table.
but I have followed the above mentioned link for "Standard Change" where the type is defaulted to "standard",In result test steps for the "Normal change" is getting failed.
Can you tell me how to create a standard change from "Run Server Side Script".We have tried similar to this but we couldnt able to fetch details like Short description,Description,Assignment group and other values from standard change template.
Thanks & Regards
Fedrick

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 01:15 AM
Hi Fedrick
You can use the query in the below format:
var standardTemplate = new GlideRecord('std_change_record_producer');
standardTemplate.addQuery('active', true);
//You can also add a query to get the required template
standardTemplate.query();
standardTemplate.next();
var gr = new GlideRecord('change_request');
gr.applyTemplate(String(standardTemplate.template.name)); //This step applies the queried template
gr.setValue('type', 'standard');
gr.setValue('short_description', 'This is my short descr');
var sysID = gr.insert();
--
Cheers
Ankush

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 04:06 AM
Thanks Ankush Agrawal:)