ATF - Change Management module - Expedited change: Unable to capture "OK" button on alert.

samirmantri
Tera Contributor

ATF - Change Management module - Expedited change: Unable to capture "OK" button on alert when clicked on "Request Approval".

So, is there any step to click on OK on alert - Your change will be locked once you move to Authorise state. Press 'OK' to proceed. ?

I've tried to add a step - Click Component (Custom UI), however it's unable to retrieve this component.

5 REPLIES 5

Shaqeel
Mega Sage

@samirmantri 

 

It is one of the limitations of ATF that you can not operate on Pop ups.

Although you can try click modal button, it works some times.

*************************************************************************************************************
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

Shaqeel


***********************************************************************************************************************
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

Shaqeel

Thanks for your inputs. I tried adding step "Click Modal button" with Form UI as "Standard UI", UI Page as "glide_alert_standard" and Button = "ok_button". However, it fails with error - FAILURE: Did not find GlideModal

Then is not possible through ATF.

You can search for limitations of ATF.

 

*************************************************************************************************************
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

Shaqeel


***********************************************************************************************************************
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

Shaqeel

Hi @samirmantri ,

You cannot test Pop-Ups through ATF, as far as I know. However, if you want to proceed with testing your requirements, you can try writing a script in the 'Run Server Side Script' test step.

Below is a script you can try:

// Script yo change the State

 

 
   
    var changeRequestSysId = steps('74e2697387174e1828bdfee4dabb3516').first_record; //Test Step sys_id of Record Query of Change Request
    gs.log(' changeRequestSysId ' + changeRequestSysId);
    gs.log('Sys  ID of Change Request is:  ' + changeRequestSysId); //true
    // Get the Change Request record
    var changeGR = new GlideRecord('change_request');
    if (changeGR.get(changeRequestSysId)) {
        // Check if the current state is "Schedule"
        if (changeGR.state == -2) { // Assuming 3 is the value for "Schedule"
            // Set the state to "Implement"
            changeGR.state = -1; // Assuming 4 is the value for "Implement"
            changeGR.update();
            gs.log('Change Request state updated to Implement.');
            // Add result to stepResult to confirm the state change
            stepResult.setOutputMessage('Change Request state updated to Implement.');
        } else {
            gs.log('Change Request is not in the Schedule state.');
            stepResult.setOutputMessage('Change Request is not in the Schedule state.');
        }
    } else {
        gs.log('Change Request not found.');
        stepResult.setOutputMessage('Change Request not found.');
    }
 
Please mark my answer helpful if it helps you and accept it as a solution to assist the ServiceNow community.