Creating Test Cases
Once the process workflow is saved, follow the instructions mentioned below to write the test cases:
- In the Tool Bar menu of Studio page, click the
(QA) icon and then click Create. The Test Case dialog box appears.
- In the Test Case Name field, enter a name of your choice as per your business requirement. Following are the guidelines to provide the Test Case Name:
- It should be greater than one character and should not be more than 25 characters.
- It should only contain alphanumeric, _ (underscore), and – (hyphen) special characters.
- It should be unique i.e., the test case name should not be same as any other test case already created.
- In the Test Case Description field, enter a small description about the test case that you want to create. Following are the guidelines to provide the Test Case Description:
- It should be greater than one character and should not be more than 255 characters.
- Click Next. The Test Case Input Data dialog box appears.
- Click Add to add any input arguments value. A row gets added to select the input argument created for the automation process. Pass the test data in the Value field for the selected argument. This test data will be sent as an input to the process.
Adding input arguments is an optional step and should be opted only when input data is required to execute the test case.
- From the Select Argument dropdown list, select the relevant argument.
All the arguments having In direction with Text, Numeric, Boolean, Decimal, Double and DateTime datatype can be selected. The Argument Type gets visible for the selected argument. - In the Value field enter the value of argument. Example of values for different Argument Types are: Numeric – 34, Text – Hello, Boolean – true, Decimal – 2.56, Double – 2.56 and DateTime – 02-FEB-1978.
- Repeat step 5 through step 7 to add multiple input arguments.
NOTE:
- If you have added any row for Test Case Input argument, then selecting the argument and providing the test data in the Value field is a mandatory step.
- You cannot add the same input argument again in the Test Case Input Data dialog box.
- Do not add any PII or client sensitive data as the Test Case input.
- Click the
(Delete) icon if you want to delete the added argument .
- Click Next. The Test Case Assertions dialog box appears.
- Click Add to add the output arguments value and the condition.
NOTE:
You must add at least one assertion for the test case to pass or fail.
A row gets added to configure the output argument. Every row is identified with a unique ID which is the assertion ID that gets incrementally generated when a new assertion is added within the test case. For example, for the first assertion, ID is 1 and for the next assertion, ID is 2. - From the Select Argument dropdown list, select the relevant argument for which output value needs to be validated. All the arguments having Out and In/Out direction with Text, Numeric, Boolean, Decimal, Double, DateTime, List, Array, Dictionary and DataTable datatype can be selected. The Argument Type gets visible for the selected argument.
Depending upon the datatype of the selected argument, the available assertion options for selecting Validation/Passing Criteria varies:
Argument Type Validation/Passing Criteria Description Text - Equals
- Not Equals
Asserts if the provided output string value is equal or not equal to the actual string value of the argument. Numeric - Equals
- Less Than
- Greater Than
- Less Than or Equal
- Greater Than or Equal
Asserts if the provided output integer value is equal, less than, greater than, less than or equal to, greater than or equal to the actual integer value of the argument. Boolean - Equals
- Not Equals
Asserts if the provided output Boolean value is equal or not equal to the actual Boolean value of the argument. Decimal - Equals
- Less Than
- Greater Than
- Less Than or Equal
- Greater Than or Equal
Asserts if the provided output decimal value is equal, less than, greater than, less than or equal to, greater than or equal to the actual decimal value of the argument. Double - Equals
- Less Than
- Greater Than
- Less Than or Equal
- Greater Than or Equal
Asserts if the provided output double value is equal, less than, greater than, less than or equal to, greater than or equal to the actual double value of the argument. DateTime - Equals
- Less Than
- Greater Than
- Less Than or Equal
- Greater Than or Equal
Asserts if the provided output datetime value is equal, less than, greater than, less than or equal to, greater than or equal to the actual datetime value of the argument. It supports only two output formats i.e., dd-MMM-yyyy and dd-MMM-yyyy HH:mm:ss. You can convert the argument of DateTime to above format using .toString (‘dd-MMM-yyyy HH:mm:ss) List - Length
- Contains
Length asserts if the provided output value is equal to the actual length of the list i.e., the number of elements in the list.
Contains asserts if the provided output value is one of the elements present within the list.
Sample value are:
List<String> - New List(Of String) From {"Value1", "Value2", "Value3"}List<Integer> - New List(Of Integer) From {1, 5, 10, 15, 20}
Array - Length
- Contains
Length asserts if the provided output value is equal to the actual length of the array i.e., the number of elements in the array.
Contains asserts if the provided output value is one of the elements present within the array.
Sample values are:
Int32[] - New Integer() {1, 2, 4, 8}String[] - New String() {"Hello", "World"}
Dictionary - Length
- Contains a Key
- Contains a Value
Length asserts if the provided output value is equal to the actual length of the dictionary i.e., the number of key-value pairs in the dictionary.
Contains a Key asserts if the provided output value is one of the key present within the dictionary.
Contains a Value asserts if the provided output value is one of the value present within the dictionary.
Sample values are:
Dictionary<Integer,String> - New Dictionary(Of Integer, String) From {{ 1, "Test1" }, { 2, "Test2" }}sDataTable - No of Rows
- No of Columns
- Contains a Value in Column
- Equals
- Less Than
- Greater Than
- Less Than or Equal
- Greater Than or Equal
DataTable assertions may depend upon column index and row index and is listed in the below table.
.
The Column Index and Row Index columns are applicable only for arguments with DataTable argument type. The behavior of these columns changes based upon the selected assertion for the DataTable argument.
NOTE: |
Column Index and Row Index accept only the integer value for the index starting from zero. For example, for the first row the index will be zero. |
Assertion | Column Index | Row Index | Description |
No of Rows | Disabled | Disabled | Asserts if the provided output value is equal to the actual total number of rows in the selected DataTable. |
No of Columns | Disabled | Disabled | Asserts if the provided output value is equal to the actual total number of columns in the selected DataTable. |
Contains the value in Column | Enabled | Disabled | Asserts if the provided output value is present in the column for which the column index is provided. |
Equals | Enabled | Enabled |
Asserts if the provided output value is equal to the actual value present in the DataTable cell for the provided column and row index. |
Less Than | Enabled | Enabled | Asserts if the provided output value is less than the actual value present in the DataTable cell for the provided column and row index. |
Greater Than |
Enabled | Enabled | Asserts if the provided output value is greater than the actual value present in the DataTable cell for the provided column and row index. |
Less Than or equal |
Enabled | Enabled | Asserts if the provided output value is less than or equal to the actual value present in the DataTable cell for the provided column and row index. |
Greater Than or equal | Enabled | Enabled | Asserts if the provided output value is greater than or equal to the actual value present in the DataTable cell for the provided column and row index. |
.
- In the Value field, enter the desired output value with which the assertion successfully passes.
NOTE:
For every added test case output argument, selecting the Argument, asserting Validation/Passing Criteria, entering the test data value in Value field are mandatory steps. The Column Index and Row Index field values becomes mandatory and depends upon the selected assertion for the DataTable argument type.
- Repeat step 11 through step 13 to add multiple output arguments.
NOTE:
You can configure one argument with multiple assertions. - Click the
(Delete) icon if you want to delete the added argument.
- Click Confirm.
A success message is displayed signifying the test case has been added to the process.