How to change a field value through step "Run Server Script" within ATF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 01:35 AM
I am creating one incident record through ATF, now i want to update one of the field value from test step "Run Server Script", i am using below mentioned script but its not working, please suggest if this is actually possible to do or not.
If i will try to update those incident fields then i would be using background script or fix script but in ATF i not getting the right approve to achieve the same.
(function(outputs, steps, stepResult, assertEqual) {
var gr = new GlideRecord('x_amex_sourcing_request_request');
gr.get(steps('39f955d31b0f81906f82ca6b234bcb48').record_id);
gr.query();
if(gr.next()){
gr.x_amex_sr_si_service_description = 'Testing by vikas000';
gr.update();
}
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 04:02 AM
HI,
Not what you asked, but thought it worth a mention. For what you are doing could you not use:
Test Step: Form (|| 'Forms in Service Portal') > 'Set Field Values' (SP)
or
Test Step: Server > Record Update
atb,matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 04:11 AM
If scripting could you use:
gr.setValue('x_amex_sr_si_service_description','Testing by vikas000');
hth,matt