How to perform Risk Assessment with ATF

shital7
Tera Contributor

Hi,

We have a requirement to perform Risk Assessment with ATF, I am new to the ATF so not sure how to proceed with this, But below mentioned are the test steps that I have configured In order to perform Risk Assessment.

1) Test step: Click on UI action 'Risk Assessment'

2) Test step for submit the risk assessment: Click Modal Button

  and I am passing the parameter for UI page: assessment_take2, button: submit_sign

find_real_file.png

 

But it is failing with error 'FAILURE: Did not find GlideModal'. Any help with this topic would be much appreciated.

{P.S : I just need to click submit button, the other risk questionnaires will have automated answers populated to it}

Thanks,

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

check this link

ATF Steps for Change Risk Assessment [HOWTO]

Try to use Custom UI test steps and retrieve the components.

Regards
Ankur

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

Hi Ankur,

 

Thank you for the response,  How should I access these retrieved components.

Hi,

you need to add step for custom UI and then retrieve it.

It runs all the steps prior to the one you are adding and detects the HTML components

Regards
Ankur

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

saidinesh
Tera Expert

We can generate an assessment using a script by utilizing the Run server-side script and then inserting answer in the value column

    var gr = new GlideRecord("change_request");
    gr.get(steps("GIVE SUBMIT/RECORD QUERY STEP SYS ID HERE").record_id);
 
    new ChangeRiskAsmt().invokeAssessment({
        "tableName""change_request",
        "sysId": gr.sys_id,
        "userId": gs.getUserID(),
        "copyAsmt"false
    });

    var chga = new GlideRecord('asmt_assessment_instance_question');
    chga.addEncodedQuery("source_id=" + gr.sys_id);
    chga.query();
    while (chga.next()) {
        //INSERT YOUR IF ELSE CONDITIONS HERE TO SET THE VALUES
        chga.value = 1;
        chga.update();
    }