How do I set a variable value on the catalog task interface using ATF?

Ravish Shetty
Tera Guru

Hi all,

 

I am creating an end to end ATF test case where the user is submitting a laptop request, the request gets approved and fulfilled.

We have a test step in the middle of the fulfillment process where the fulfillment team enters the serial number of the laptop in the variable editor field of the Catalog task. I am looking for help on automating this step. 

Somehow, the Custom UI step is not able to pull all the elements of this page.

 

find_real_file.png

 

Thanks,

Ravish

12 REPLIES 12

Hi Ravish,

 

Do you mind sharing how you were able to update these variables through a server script?

below is the code that i am using for a new ATF step that i am writing. this is because of 2 reasons. these variables are dropdown variables and their dropdown values are generated through an on load script when the page loads and hence it is not possible to set their value through regular means in ATF and also the 'set variable value' is not working as intended

 

 

(function(outputs, steps, params, stepResult, assertEqual) {

    var ritm_object = new GlideRecord("sc_req_item");
    ritm_object.addEncodedQuery("sys_created_onONLast 15 minutes@javascript:gs.beginningOfLast15Minutes()@javascript:gs.endOfLast15Minutes()^cat_item=" + gs.getProperty('CATALOG.SYS.ID') + "^task_for=" + params.u_requester);
    ritm_object.orderByDesc('sys_created_on');
    ritm_object.query();

    if (ritm_object.next()) {
        ritm_object.variables.architect = params.architect ;
        ritm_object.variables.delivery_lead= params.delivery_lead;
        ritm_object.update();
    }
})(outputs, steps, params, stepResult, assertEqual);

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Ravish Shetty 

Hope you are doing good.

Did you get a chance to check on the solution provided to resolve your query?

If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader