Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Forms in Service Portal category

Validate the functionality of fields and UI actions in Service Portal form widgets.

Service Portal dependency

Creating automated Service Portal steps requires knowledge of the ServiceNow data model and Service Portal form and data structures.

Open a Form (SP)

Opens a form in a portal.

Use this step for the base system Form page. For custom form pages, use the Open Service Portal Page step from the Custom UI category.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
TimeoutNumber of seconds allowed before the step fails. If the validation fails, the system repeats the step until it reaches the duration of the timeout. If the validation fails after the timeout duration has passed, the step fails.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.
PortalPortal in which the defined form opens. Service Portal is the default.
PagePage to open in the defined portal. The form page is the default.
TableTable containing the form to open.
sys\_idSys\_id of the record to open. Default is `-1`, which opens a new record.
ViewThe form view to open. If blank, the system uses the default view.
Query parametersAdditional URL query parameters and values for the form.

Set Field Values (SP)

Sets the values of fields in a form. To use this step, you must have already opened a form using the Open a Form (SP) test step.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.Note: Use the condition builder to set the field value. The condition builder displays an appropriate control for the field data type. For example, a reference field displays a Lookup record control.
TableThe table for the form on which to set field values. The value should be the table in the Open a Form (SP) step.
Field valuesFields for which to set values and the values to be set for those fields.

Field Values Validation (SP)

Validates field values on the current form based on defined conditions. To use this step, you must have already opened a form using the Open a Form (SP) test step.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.Note: Use the condition builder to set the field value. The condition builder displays an appropriate control for the field data type. For example, a reference field displays a Lookup record control.
TableThe table that contains the form on which to validate fields. The value should be the table in the Open a Form (SP) step.
ConditionsConditions used to validate one or more fields on the form. If the condition evaluates to true, the step passes.

Field State Validation (SP)

Validates field states on a form in Service Portal.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.
TableThe table for the form on which to validate field states. The value should be the table in the Open a Form (SP) step.
VisibleValidates whether the fields on this form are visible. The test fails if the fields are not visible.
Not visibleValidates whether the fields on this form are visible. The test fails if the fields are visible.
Read onlyValidates whether the fields on this form are read only. The test fails if the fields are not read only.
Not read onlyValidates whether the fields on this form are read only. The test fails if the fields are read only.
MandatoryValidates whether the fields on this form are mandatory. The test fails if the fields are not mandatory.
Not MandatoryValidates whether the fields on this form are mandatory. The test fails if the fields are mandatory.

Add Attachments to Form (SP)

Test the functionality of attaching a file to a Service Portal form widget.

To use this step, you must have already opened a form using the Open a Form (SP) test step or Open Service Portal Page steps. This step can't be used after a Submit Form step or Click a UI Action step has been used.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
NotesNotes about the test step.
Upload AttachmentsButton to attach one or more files to the form.

UI Action Visibility Validation (SP)

Determines whether a UI action on the current Service Portal form is visible. To use this step, you must have already opened a form using the Open a Form (SP) test step.

Service Portal only supports server UI actions. The setRedirectURL() method and client UI actions are not supported. UI action visibility can vary depending on the currently logged in or impersonated user.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.
TableThe table for the form on which to check UI action visibility. The value should be the table in the Open a Form (SP) step.
VisibleFields from the UI Actions table to be checked for visibility. Includes only form-based UI actions. The test fails if the UI action is not visible on the form for the currently logged in user.Note: If the list contains UI actions with the same name, check the form to determine the sys_id of the element. Then filter by sys_id in the UI Action table to select the correct element in the step.
Not visibleFields from the UI Actions table to be checked for visibility. Includes only form-based UI actions. The test fails if the UI action is visible on the form for the currently logged in user.Note: If the list contains UI actions with the same name, check the form to determine the sys_id of the element. Then filter by sys_id in the UI Action table to select the correct element in the step.

Click UI Action (SP)

Selects a UI action on the current Service Portal form and outputs the table and sys_id of the record on which the action was selected.

To use this step, you must have already opened a form using the Open a Form (SP) test step. After using this step, you cannot use any other form steps.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
TimeoutNumber of seconds allowed before the step fails. If the validation fails, the system repeats the step until it reaches the duration of the timeout. If the validation fails after the timeout duration has passed, the step fails.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.
TableThe table for the form on which to click a UI action. The value should be the table in the Open a Form (SP) step.
UI actionThe UI action to click, selected from the UI Actions table. Includes only form-based UI actions.
Assert typeSpecifies where to check for form submission after clicking the UI action:- --None--: Selects the UI action without validating mandatory or other fields. - Form submission canceled in browser: Checks whether the form was canceled in the browser and did not reach the server due to validation or other issues. - Form submitted to server: Checks whether the form was submitted to the server.
FieldDescription
record_idSys_id of the record on which the action was clicked.
tableTable with the clicked UI action.

Submit a Form (SP)

Submits the current form in a Service Portal page and outputs the table and sys_id of the submitted record.

To use this step, you must have already opened a form using the Open a Form (SP) test step. After using this step, the page closes. You can't use any other steps on the current page.

FieldDescription
Execution orderInteger specifying the order in which the test executes this step.As you create steps, the system automatically assigns each step an incremental value. This value causes the test to execute steps in the order that you created them in. You can change this default order by editing the Execution order values.
ActiveOption to activate this test step for use.
TimeoutNumber of seconds allowed before the step fails. If the validation fails, the system repeats the step until it reaches the duration of the timeout. If the validation fails after the timeout duration has passed, the step fails.
ApplicationApplication scope in which the system runs this step.
TestRead-only name of the test that you're adding the step to.
Step configRead-only name of the step.
DescriptionDescription of the test step. This field value is automatically set based on the field values of the test step. This field appears after the test step is submitted.
NotesNotes about the test step.
Assert typeSpecifies where to check for form submission:- --None--: Submits the form without validating mandatory or other fields. - Form submitted to server: Checks if the form was submitted to the server. - Form submission canceled in browser: Checks whether the form was canceled in the browser and did not reach the server due to validation or other issues.
FieldDescription
record_idSys_id of the submitted record.
tableTable for the submitted record.