Test what you built
Summarize
Summary of Test Agent
Test Agent enhances the software development lifecycle in ServiceNow by automating test creation, execution, and failure analysis for code produced by Build Agent. It enables a seamless build-to-test workflow within a single development session, removing the need for manual test authoring or troubleshooting. By generating Automated Test Framework (ATF) functional and UI tests automatically, executing them, and performing root cause analysis (RCA) on failures, Test Agent ensures that code changes are safe and reliable before release.
Show less
Key Features
- Automated Test Generation: Test Agent prompts developers after each Build Agent development action to generate ATF tests, which can be accepted or declined. This keeps test creation integral to the development process, reducing the risk of skipped test coverage.
- UI Testing Support: In addition to functional tests, Test Agent can generate comprehensive UI tests that cover browser-level interactions and multi-step navigation flows.
- Assisted Troubleshooting and Auto-Healing: When tests fail, Test Agent automatically performs RCA and either applies safe fixes autonomously or provides actionable guidance within the Build Agent chat panel. Build Agent uses this information to re-run tests until all pass, streamlining failure resolution.
- Automatic Test Maintenance: The system identifies and updates or removes stale ATF tests to reflect current application changes, ensuring the test suite remains aligned with evolving code without manual intervention.
- Integration and Execution: Generated ATF tests are stored under the relevant application scope and can be scheduled for regression runs. Test execution requires installed ATF Test Generator and Cloud Runner apps with a configured cloud user.
Practical Benefits for ServiceNow Customers
- Build and Test in One Session: Developers can author code and tests sequentially in the same workflow, reducing context switching and increasing efficiency.
- Faster Failure Resolution: Automated RCA and proposed fixes minimize time spent investigating test failures, accelerating development cycles.
- Increased Release Confidence: Automated test execution enforces quality gates and provides measurable evidence of code health prior to production deployment.
Scope and Availability
Test Agent supports authoring environments including ServiceNow Studio, ServiceNow IDE, and the ServiceNow SDK (for execution only). It works with global, custom, and store application scopes and supports both functional and UI ATF tests. Test execution is targeted at Cloud Runner lanes, requiring the ATF Test Generator and Cloud Runner applications installed and configured.
Test Agent generates test coverage for code created by Build Agent, executes tests, and performs root cause analysis (RCA) on failures. Prompt Test Agent to complete build-to-test workflows in a single development session without manual test authoring or failure investigation.
Test Agent extends Build Agent by making every build safe before release. After Build Agent produces code changes in a development instance, Test Agent consumes the same prompt and code context. It uses those to author functional Automated Test Framework (ATF) tests, execute those tests, and triage any failures automatically.
- For details on configuring tests in Build Agent, see Configure auto test prompting and UI tests.
- For more information ATF test generation, see ATF test generation in Build Agent.
- For complete documentation on using Test Agent, see Test Agent.
If a test fails, Test Agent performs an RCA. Then it either auto-applies safe fixes or surfaces actionable guidance in the chat panel so you can resolve the issue without leaving ServiceNow Studio or the ServiceNow IDE.
Customer outcomes
Test Agent delivers the following measurable outcomes:
- Build and test in one session: You no longer need to context-switch between authoring code and writing tests. Both happen sequentially within the same Build Agent session.
- Faster failure triage: Automated RCA and proposed fixes reduce the time you spend looking through logs after a test run.
- More release confidence: Measurable quality gates enforced by automated test execution give you verifiable evidence of code health before promotion to production instances.
- Generated ATF tests are stored in the sys_atf_tests [sys_atf_tests] table under the app scope for which they were created. You can schedule regression test runs using the generated tests.
Test generation prompting
Automatic prompting for tests reduces the chance of skipping test coverage during rapid development by keeping test generation as part of the standard development loop.
To manually prompt for tests, ask Build Agent to Generate ATF tests for all the feature permutations on the app we built. Then, you can tell Build Agent to Execute all ATF tests.
Test Agent workflow
The end-to-end workflow is:
- Create or edit an app in a development instance using Build Agent in ServiceNow Studio or the ServiceNow IDE, driven by your prompt.
- Test Agent consumes the prompt and the resulting code changes to generate contextually relevant functional and UI ATF tests.
- Respond to Build Agent asking whether you want to run the tests.
- Failures are automatically triaged. Test Agent produces an RCA and either applies safe fixes autonomously or proposes them to you through the Build Agent chat panel.
- Build Agent ingests the RCA from Test Agent and re-executes tests until a passing status is achieved, completing the auto-heal loop. Stale tests are automatically updated to reflect the newest functionality.
Key developer experiences
- Autonomous test authoring
- When you use Build Agent to implement a story, you can prompt it to create functional and UI tests automatically.
- UI testing
- Generate comprehensive UI tests for applications you build with Build Agent. UI testing extends the existing functional test capability to cover browser-level interactions, such as multi-step page navigation flows. Request a UI test by prompting Build Agent to generate a UI test for the application or flow you want to validate. For more information, see UI Test Script in Automated Test Framework (ATF).
Figure 2. UI tests - Assisted troubleshooting
- Test Agent automatically troubleshoots failed tests, generates RCAs, and proposes targeted fixes, eliminating manual log investigation.
- Auto-healing
- Build Agent consumes the RCA produced by Test Agent and applies fixes to code or tests, then re-executes the test suite until all tests reach a passing status. This removes the need for developers to manually patch and maintain tests during a session.
- Automatically updated tests
- Test Agent automatically identifies outdated ATF tests as your application changes, and updates or removes them to keep your test suite aligned with your current code. Tests that no longer map to application artifacts are removed. Tests that partially match updated artifacts are revised to reflect the current implementation. Automatic test maintenance reduces the overhead of keeping ATF tests synchronized with ongoing development and removes the need to manually audit and update tests after each code change.
Scope and availability
Test Agent is available in the following environments and scopes:
| Dimension | Supported values |
|---|---|
| Authoring environment | ServiceNow Studio, the ServiceNow IDE, and the ServiceNow SDK (execution tool only) |
| Application scope | Global, custom, store |
| Test types | ATF functional and UI tests |
| Execution target | Cloud Runner lanes |