Create a parameterized test
Build a test that uses variables to store test data.
始める前に
手順
- Navigate to All > Automated Test Framework > Tests.
-
Click New.
A blank Test record opens.
-
On the form, fill in the fields.
Field Description Name Enter a name for the test. Active Enable Enable parameterized testing Enable Description Enter a description for the test. -
Click Save.
Parameterized testing related lists appear.
-
Create a parameter to hold test run data.
A parameter is a variable that stores a particular type of test data. Each parameter has a unique label and a data type. For example, you can create a parameter to store the Sys ID of a reference field or the integer value of a choice field.
-
In the Parameter Definitions related list, add a parameter.
- Add Exclusive Parameters: Adds a parameter available to this test only.
- Add Shared Parameters: Adds a parameter available to any parameterized test.
-
Define the name of the variable and the data type.
When creating parameters for a form, the parameter data type must match the field data type. For example, if you are creating a parameter to test a reference field on a form, you must create a parameter of type Reference. For more information on ServiceNow AI Platform data types, see Field types.
- Click Submit.
-
In the Parameter Definitions related list, add a parameter.