ATF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2024 11:13 PM
What is the need for Record Update after the server-side script in ATF and why do we use open existing records after Server Side Script test step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2024 11:19 PM
Hi @SnigdhP77706229 ,
Record update is use to update the record generally post 'Record query' step. This is a server side step.
In order to open the step on the client test runner, we have to use client side supported step which is 'open existing record', this will open the form in client test runner window and screenshots could be captured of it.
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 12:02 AM
Here need to understand what the use of Record update after Server-side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 12:14 AM
Hi @SnigdhP77706229 ,
(function(outputs, steps, stepResult, assertEqual) {
var change_sys_id = steps("873891bd53412300e321ddeeff7b12e8").record_id;
var changeGr = new GlideRecord("change_request");
changeGr.get(change_sys_id);
if (!changeGr.chg_model.nil()) {
changeGr.setValue("chg_model", "");
changeGr.update();
}
outputs.record_id = change_sys_id;
})(outputs, steps, stepResult, assertEqual);
In the above code, it is getting the step2 sysID which is
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 12:40 AM
The usage of the step depends on many factors, like, As you said, the server-side script is already executed and now if you want to change something in the record, you can use the update Record step in ATF. I can see, you created a change request but in Update Record, you want to update the type, practically not a good way, the selection of the type of change should be done in creation time only and then in update, you can change it to other.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************