ATF: Test a form in different views.

S_59
Tera Contributor

I am working on ATF on a requirement where the requestor opens the form and clicks on "Final expenses" button and additional two fields are visible on the form (View changes in the same page after clicking on Final expenses) which are mandatory. I am redirected to portal home page after clicking the button instead of changing the view. Please guide me if come across anything similar to this or you have created ATF for this type of scenario. 

Thanks

4 REPLIES 4

cloudops
Tera Expert

Sure, I can guide you on how to create an Automated Test Framework (ATF) for this scenario. Here are the steps:

1. **Create a new Test Suite**: Navigate to Automated Test Framework > Test Suites. Click on New to create a new Test Suite.

2. **Create a new Test Case**: Inside the Test Suite, create a new Test Case.

3. **Open a Form**: Use the 'Open a new form' step to open the form where the 'Final expenses' button is located.

4. **Click a UI Action**: Use the 'Click a UI Action' step to simulate clicking the 'Final expenses' button.

5. **Validate Form Fields**: Use the 'Validate form field' step to check if the two additional fields are visible and mandatory.

6. **Validate Redirect**: If you are being redirected to the portal home page, it might be due to some client-side script or UI policy that is causing the redirection. You can use the 'Validate current URL' step to check if the URL is the expected one after clicking the button.

7. **Run the Test Case**: Once you have set up the test case, you can run it to see if it passes or fails.

Please note that ATF does not support testing of client-side scripts, so if the 'Final expenses' button is running a client-side script that changes the form view, ATF might not be able to test it.

 

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - nowgpt.ai

S_59
Tera Contributor

 

 

Thanks

Hi @S_59 

 

Ignore these AI generated answers.

Use Open existing record >>(to the click a UI action Final expenses)

Shaqeel_0-1706013980073.png

 

and I don't think you can change the view like this.

You can try one thing

You can set a default view for some other user manually and impersonate with that user and open the record.

But the chances are low.

 

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

Swaraj Bhandare
Tera Contributor

@S_59 You can not actually set a view within ATF, so you can use any existing user with that view instaead of creating a new user. 

Hope this answers your question. Please mark it helpful and click on the Thumb Icon.