--- title: Automated Test Framework Test API - ServiceNow Fluent description: The Automated Test Framework Test API defines automated tests \[sys\_atf\_test\] that you can run to confirm that your instance works after making a change.Create an automated test \[sys\_atf\_test\] containing a series of steps to execute. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/application-development/servicenow-sdk/atf-test-now-ts.html release: australia product: ServiceNow SDK classification: servicenow-sdk topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 4 breadcrumb: [ServiceNow Fluent API reference, Reference, ServiceNow SDK, Building applications in source code, Building pro-code applications, Developing your application, Building applications] --- # Automated Test Framework Test API - ServiceNow Fluent The Automated Test Framework Test API defines automated tests \[sys\_atf\_test\] that you can run to confirm that your instance works after making a change. **Note:** For the latest ServiceNow Fluent API documentation and examples, see the [ServiceNow Fluent API reference](https://servicenow.github.io/sdk/category/api-reference) and [ServiceNow SDK examples repository](https://github.com/ServiceNow/sdk-examples) on GitHub. For general information about Automated Test Framework tests, see [Automated Test Framework \(ATF\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/atf-landing-page.md). **Parent Topic:**[ServiceNow Fluent API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/servicenow-fluent-api-reference.md) **Related topics** [ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-fluent.md) ## Test object Create an automated test \[sys\_atf\_test\] containing a series of steps to execute.
Name Type Description
$id String or Number Required. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`
name String A unique name for the test.
description String A description of what the test does.
active Boolean Flag that indicates whether the test is active.Valid values: - true: The test is active. - false: The test isn't active. Default: true
failOnServerError Boolean Flag that indicates whether to fail when a server error occurs during the test.Valid values: - true: The test fails when a server error occurs. - false: The test doesn't fail when a server error occurs. Default: true
configurationFunction Function The steps of the test. Test steps are passed as statements within the atf function. For example:```javascript (atf) => { atf.form.openNewForm({ table: 'sn_example_table', formUI: 'standard_ui', view: '', }) } ``` For more information about test steps, see [Supported test steps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/atf-test-now-ts.md).
$meta Object Metadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances. ```javascript $meta: {       installMethod: 'String' } ``` Valid values for installMethod: - demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected. - first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.
The output values of test steps with output variables can be saved as variables and used as inputs to other steps using the syntax `output.`. The output variables can be used both directly as inputs on appropriate fields or inside of a template string, such as with `atf.server.log` in the following example. ```javascript import { Test } from '@servicenow/sdk/core' Test({ active: true, failOnServerError: true, name: 'Simple example', description: 'An illustrative test written in fluent', $id: Now.ID[1], }, (atf) => { atf.form.openNewForm({ table: 'sn_table_app_reptile_table', formUI: 'standard_ui', view: '', }) atf.form.setFieldValue({ table: 'sn_table_app_reptile_table', formUI: 'standard_ui', fieldValues: { reptiles: 'lizard' as any, }, }) const output = atf.form.submitForm({ assertType: 'form_submitted_to_server', formUI: 'standard_ui' }) atf.server.recordValidation({ recordId: output.record_id, table: 'sn_table_app_reptile_table', assertType: 'record_validated', enforceSecurity: true, fieldValues: 'reptiles=lizard', }) atf.server.log({ log: `Submitted record with sys_id: ${output.record_id} to table ${output.table}` }) } ) ``` ### Supported test steps The following test steps are supported. For information about step properties, see the [Automated Test Framework \(ATF\) test step categories](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-step-categories.md) documentation. **Note:** Some fields available for test steps on forms aren't available as properties in ServiceNow Fluent.
Category Steps
[Application Navigator category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-app-navigator-category.md) - atf.applicationNavigator.applicationMenuVisibility - atf.applicationNavigator.moduleVisibility - atf.applicationNavigator.navigateToModule
[Email category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-email-category.md) - atf.email.generateInboundEmail - atf.email.generateInboundReplyEmail - atf.email.generateRandomString - atf.email.validateOutboundEmail - atf.email.validateOutboundEmailGeneratedByFlow - atf.email.validateOutboundEmailGeneratedByNotification
[Form category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-form-category.md) - atf.form.addAttachmentsToForm - atf.form.clickDeclarativeAction - atf.form.clickModalButton - atf.form.clickUIAction - atf.form.declarativeActionVisibility - atf.form.fieldStateValidation - atf.form.fieldValueValidation - atf.form.openExistingRecord - atf.form.openNewForm - atf.form.setFieldValue - atf.form.submitForm - atf.form.uiActionVisibility
[Forms in Service Portal category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-forms-portal-category.md) - atf.form\_SP.addAttachmentsToForm - atf.form\_SP.clickUIAction\_SP - atf.form\_SP.fieldStateValidation\_SP - atf.form\_SP.fieldValueValidation\_SP - atf.form\_SP.openForm\_SP - atf.form\_SP.openServicePortalPage - atf.form\_SP.setFieldValue\_SP - atf.form\_SP.submitForm\_SP - atf.form\_SP.uiActionVisibilityValidation\_SP
[Quick start tests for Dashboards](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/quick-start-tests-dashboards.md) - atf.reporting.responsiveDashboard - atf.reporting.responsiveDashboardSharing
[REST category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-rest-category.md) - atf.rest.assertJsonResponsePayloadElement - atf.rest.assertResponseHeader - atf.rest.assertResponseJSONPayloadIsValid - atf.rest.assertResponsePayload - atf.rest.assertResponseTime - atf.rest.assertResponseXMLPayloadIsWellFormed - atf.rest.assertStatusCode - atf.rest.assertStatusCodeName - atf.rest.assertXMLResponsePayloadElement - atf.rest.sendRestRequest
[Server category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-server-category.md) - atf.server.addAttachmentsToExistingRecord - atf.server.checkoutShoppingCart - atf.server.createUser - atf.server.impersonate - atf.server.log - atf.server.recordDelete - atf.server.recordInsert - atf.server.recordQuery - atf.server.recordUpdate - atf.server.recordValidation - atf.server.replayRequestItem - atf.server.runServerSideScript - atf.server.searchForCatalogItem - atf.server.setOutputVariables
[Service Catalog category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-service-catalog-category.md) - atf.catalog.addItemToShoppingCart - atf.catalog.openCatalogItem - atf.catalog.openRecordProducer - atf.catalog.orderCatalogItem - atf.catalog.setCatalogItemQuantity - atf.catalog.setVariableValue - atf.catalog.submitRecordProducer - atf.catalog.validatePriceAndRecurringPrice - atf.catalog.variableStateValidation - atf.catalog.validateVariableValue
[Service Catalog in Service Portal category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-catalog-portal-category.md) - atf.catalog\_SP.addItemtoShoppingCart\_SP - atf.catalog\_SP.addOrderGuidetoShoppingCart\_SP - atf.catalog\_SP.addRowToMultiRowVariableSet\_SP - atf.catalog\_SP.navigatewithinOrderGuide\_SP - atf.catalog\_SP.openCatalogItem\_SP - atf.catalog\_SP.openOrderGuide\_SP - atf.catalog\_SP.openRecordProducer\_SP - atf.catalog\_SP.orderCatalogItem\_SP - atf.catalog\_SP.reviewIteminOrderGuide\_SP - atf.catalog\_SP.reviewOrderGuideSummary\_SP - atf.catalog\_SP.saveCurrentRowOfMultiRowVariableSet\_SP - atf.catalog\_SP.setCatalogItemQuantity\_SP - atf.catalog\_SP.setVariableValue\_SP - atf.catalog\_SP.submitOrderGuide\_SP - atf.catalog\_SP.submitRecordProducer\_SP - atf.catalog\_SP.validateOrderGuideItem\_SP - atf.catalog\_SP.validatePriceAndRecurringPrice\_SP - atf.catalog\_SP.variableStateValidation\_SP - atf.catalog\_SP.validateVariableValue\_SP
[UI category](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-ui-category.md) atf.uiTestScript.runTest