{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1559,"path":"application-development/app-engine-studio/app-tutorial-test-app.md","title":"Test your application","bundle":null,"doc_type":null,"release":"australia","body":"\n# Test your application\n\nVerify that your application works as intended before publishing by testing the application experience and flow.\n\n## Before you begin\n\nRole required: admin or flow\\_designer\n\n## About this task\n\nThe final step in building an application is testing. There are several ways to test an application, including simulating the user experience and running flow executions to verify that everything works as expected.\n\nThis is the last step in the app creation tutorial. In this step, we create a test record in the record producer to verify that it triggers the flow to run. We also verify that approvals route to the correct users and that the flow performs the actions that we defined, such as updating records.\n\n<table id=\"table_odl_xfd_fdc\"><tbody><tr><td>\n\nStep 1\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-complete2.png\"\\] Alt text: Completed icon\n\n</td><td>\n\n[Planning your application](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-introduction.md)\n\n</td></tr><tr><td>\n\nStep 2\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-complete2.png\"\\] Alt text: Completed icon\n\n</td><td>\n\n[Create an app](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-create-an-app.md)\n\n</td></tr><tr><td>\n\nStep 3\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-complete2.png\"\\] Alt text: Completed icon\n\n</td><td>\n\n[Building a data model](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-data-model.md)\n\n</td></tr><tr><td>\n\nStep 4\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-complete2.png\"\\] Alt text: Completed icon\n\n</td><td>\n\n[Creating user experiences](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-experience-layer.md)\n\n</td></tr><tr><td>\n\nStep 5\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-complete2.png\"\\] Alt text: Completed icon\n\n</td><td>\n\n[Adding logic and automation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-logic-automation-layer.md)\n\n</td></tr><tr><td>\n\nStep 6\n\n</td><td align=\"justify\">\n\n\\[Omitted image \"app-tutorial-progress-wip.png\"\\] Alt text: In progress icon\n\n</td><td>\n\n[Test your application](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/app-tutorial-test-app.md)\n\n</td></tr></tbody>\n</table>For more information about testing your application, see [Testing and debugging applications](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/testing-and-debugging-applications.md).\n\nFollow along with the tutorial to test the employee travel request application.\n\n\\[Omitted video\\] Description: Test your application before deploying it.\n\n|Timestamp|Section|\n|---------|-------|\n|0:07|Activate your flow.|\n|0:10|Navigate to your instance home page.|\n|0:15|Impersonate a user to test your user experience.|\n|0:20|Find and open your record producer.|\n|0:26|Create a test record.|\n|0:42|End the impersonation.|\n|0:45|Navigate back to your flow.|\n|0:48|Test your flow using the test record that you created.|\n|0:56|Review the flow execution details.|\n|1:00|Perform additional tests to verify that branching actions and flow logic run correctly.|\n\n## Procedure\n\n1.  Navigate to **All** &gt; **App Engine** &gt; **App Engine Studio**.\n\n2.  Open your application's flow.\n\n    -   If your application isn’t already open, navigate to **All** &gt; **App Engine** &gt; **App Engine Studio**. Then open your application and select the flow under the **Logic and automation** heading.\n    -   If your flow is already open, verify that your changes are saved.\n3.  Select **Activate**, then select **Activate** again to make your flow available to run.\n\n    **Note:** You can also test your flow without activating it by creating a test record within Workflow Studio. For more information about testing before activating your flow, see [Test a flow](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/flow-test.md).\n\n    \\[Omitted image \"app-tutorial-activate-flow.png\"\\] Alt text: Select Activate within the Activate dialog to make your flow available to run.\n\n4.  Navigate to your ServiceNow AI Platform instance home page.\n\n5.  Impersonate a user to test that your record producer functions as intended.\n\n    1.  Open the user menu.\n\n        \\[Omitted image \"app-tutorial-user-menu.png\"\\] Alt text: You can impersonate a user by selecting Impersonate user within the user menu.\n\n    2.  Select **Impersonate user**.\n\n    3.  Select a user from the **Recent Impersonations** list or enter a different user's name in the user selection field.\n\n        When testing your application, you should impersonate users who have the permissions required to access the features that you're testing.\n\n        In our tutorial, we select a user with regular user permissions, as the record producer that we're testing is accessible to all users.\n\n    4.  Select **Impersonate user**.\n\n        The system updates the user menu and dashboard to reflect the correct information for the user that you’re impersonating.\n\n6.  On the home page, navigate to **All** &gt; **Self Service** &gt; **Service Catalog**.\n\n7.  Select **Services**.\n\n8.  Select your record producer from the list.\n\n    In our tutorial, we select our record producer called `Raise a travel request`.\n\n9.  Complete the record producer fields to generate a test record.\n\n10. Select **Submit**.\n\n11. End the impersonation.\n\n    1.  Open the user menu.\n\n    2.  Select **End impersonation**.\n\n12. Reopen your application's flow.\n\n    1.  Navigate to **All** &gt; **App Engine** &gt; **App Engine Studio**.\n\n    2.  Open your application.\n\n    3.  Select your flow under the **Logic and automation** heading.\n\n13. Select **Test**.\n\n14. In the **Test Flow** dialog, select the record field, then select the record that you created during the impersonation.\n\n15. Select **Run Test**.\n\n    The system runs the flow based on the test record that you selected.\n\n16. Select **Your test has finished running. View the flow execution details**.\n\n17. Review the flow execution details to verify that your flow runs as intended.\n\n    The flow execution details page enables you to view detailed information about an action or flow, such as the run-time, current state, items run, and values produced. For more information about flow execution details, see [Flow execution details](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/flow-execution-details.md).\n\n18. Perform additional tests to verify that the flow completes all desired branches of actions and flow logic.\n\n    For example, if your flow performs an action only after certain conditions are met, you can create those conditions to verify that the branching actions and logic run correctly.\n\n    In our tutorial, we simulate the manager's approval to test the branching actions and flow logic.\n\n    1.  Select the action that is in the **Waiting** state to view the action details.\n\n        \\[Omitted image \"app-tutorial-test-action-waiting-state.png\"\\] Alt text: You can view and change the state of actions within your flow.\n\n    2.  In the action details, select the test record.\n\n        \\[Omitted image \"app-tutorial-test-open-record.png\"\\] Alt text: You can open, view, and edit test records within your flow by selecting the record number, then selecting Open Record.\n\n    3.  Select **Open Record**.\n\n    4.  Open the approval record by selecting the list item in the **Approvers** list.\n\n        **Tip:** If your test record page doesn’t display the **Approvers** list, you can adjust the page configurations to display any lists that you want to appear. Complete the following steps to configure the lists that appear on your record page.\n\n        1.  On the record page, select the Additional actions icon \\(\\[Omitted image \"additional-actions-tables.png\"\\] Alt text: Additional actions icon\\).\n        2.  Select **Configure** &gt; **Related lists**.\n        3.  Select the **Approvers** list item or any other lists that you want to appear on the record page and move them from the **Available** list to the **Selected** list.\n        4.  Select **Save**.\n    5.  On the approval record page, select **Approve** to simulate the manager's approval.\n\n    6.  Navigate back to your flow.\n\n    7.  Select the refresh icon \\(\\[Omitted image \"app-tutorial-refresh-icon.png\"\\] Alt text: Refresh icon\\) to update your flow.\n\n    8.  Verify that your flow has run branching actions or flow logic based on the additional test that you performed.\n\n19. Complete this procedure to perform as many additional tests as needed to verify that all branches of your flow run correctly.\n\n\n## Result\n\nYour have tested the employee travel request application and verified that it functions as expected.\n\n## What to do next\n\nCongratulations! You have completed the app creation tutorial by planning, building, and testing an application.You are ready to start building your own applications in App Engine Studio.\n\nTo see what tasks you could perform after building an application, such as publishing or managing app deployments, see [Publish your app](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/app-engine-studio/publish-your-app.md).\n\n"}}