How to create ATF to click on UI action from Form context menu / Additional actions.

Sayali Gurav
Tera Guru
Tera Guru

I wanted to create ATF to click on the banner form context menu / Additional actions. 

ATF should be created while clicking on Context menu UI action for which I have used "Click a UI Action" test step but it doesn't work, it is showing an error 'FAILURE: Failed to find UI action 'Awaiting Customer' on 'incident' form'. How can we do this using ATF test step so that ATF can run without getting error.

SayaliGurav_1-1740379533983.png

 

 

6 REPLIES 6

Vishwa Pandya19
Mega Sage

Hello @Sayali Gurav ,

Could you share screenshot of the test step "click a ui action"?

 

Regards,

Vishwa

Ankur Bawiskar
Tera Patron
Tera Patron

@Sayali Gurav 

you should be able to use Click UI Action and select the form context menu

what did you try so far and what didn't work?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Shaqeel
Mega Sage

Hi @Sayali Gurav 

 

You are using "Click UI action" which is incorrect. This test step is used to click any button present on form.

As of now we don't have any option to click on the banner form context menu / Additional actions. 

 

But I guess you can move forward by assigning the ticket using "Set field value" of "Assigned To"

 

 

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

Murtaza Saify
Tera Contributor

Steps to Create ATF Test for Context Menu UI Action

1. Verify the UI Action

  • Navigate to System UI > UI Actions.

  • Search for the UI Action named "Awaiting Customer".

  • Ensure the UI Action is:

    • Active: The Active checkbox is checked.

    • Visible: The conditions for the UI Action are met (e.g., it is visible on the Incident form for the specified conditions).

    • Form Context: The UI Action is configured to appear in the Form Context Menu or Additional Actions.

2. Ensure the UI Action is Available in the Test Context

  • The UI Action must be available in the context of the test. For example:

    • If the UI Action is only visible for specific Incident states (e.g., "In Progress"), ensure the test creates an Incident in that state.

    • If the UI Action is role-based, ensure the test runs with the appropriate role.

3. Create the ATF Test

  1. Navigate to Test Management > Automated Test Framework > Tests.

  2. Create a new test or edit an existing one.

  3. Add the following test steps:


Test Steps

Step 1: Create an Incident

  • Use the Create Test Data step to create an Incident record.

  • Example:

    • Table: Incident

    • Fields: Set the required fields (e.g., Caller, Short Description, State).

Step 2: Open the Incident Form

  • Use the Open a Record step to open the Incident form.

  • Example:

    • Table: Incident

    • Sys ID: Use the Sys ID of the Incident created in Step 1.

Step 3: Click the UI Action

  • Use the Click a UI Action step to click the "Awaiting Customer" UI Action.

  • Example:

    • Table: Incident

    • UI Action Name: Awaiting Customer

    • Form Context: Ensure the form is open in the correct context (e.g., the Incident is in the correct state).

Step 4: Validate the Result

  • Use the Assert Condition step to validate the result of the UI Action.

  • Example:

    • Condition: current.state == 'Awaiting Customer'

    • Message: Incident state should be 'Awaiting Customer'.