User Object Adaptor Example
Introduction
The user adapter is the adapter that allows the comparisons and checks that an end user would do manually, i.e. it automates the functions that a tester can do, data comparison, setting of conditions, etc.
Initialization parameters
This adapter, unlike the rest of the adapters, does not have initialisation parameters, i.e. no information is set during the initialisation of the adapter, the information needed is obtained by using the different predefined functions.
Predefined functions (PF)
The predefined functions provided by this adapter can be classified into several groups:
- Functions for the manipulation of variables of different types. With these functions you can create and initialise variables of different types (Date, String, Integer, TASTTABLEDATA, .....), you can ask for the existence or not of a variable, you can delete a variable, compare, etc:
-
-
- setVariable,
- setArrayVariable,
- isExistVariable,
- removeVariable,
- compareVariables,
- compareParameters
-
- Functions for date processing:
-
-
- dateAddition: adds an amount (in a given unit of time) to a date.
- dateDifference: calculates the difference between two dates and returns it in the chosen time unit.
- dateWeekDay: returns the day of the week in the chosen format (number or literal).
getCurrentDategetCurrentDate: returns the current date with the established format or format by default in a parameter of type TASTDATATABE.getCurrentDateAsDategetCurrentDateAsDate: returns the current date as a Date type. Input parameters are not required.getCurrentDateAsStringgetCurrentDateAsString: Returns the current date as a String type with the format introduced by the user in the input parameter dateFormat as a value.
-
- Function for sending an email:
-
- sendEmail: This function allows you to send an email indicating the fields "to", "subject", "body" and "attachments", but it also has an added functionality: if you want, you can attach the result of the TestSet execution.
-
- Function for copying a file:
-
- copyFile
-
- Functions to execute a command in the Windows operating system or execute a JavaScript function:
-
-
- executeCommand,
- executeCommandParam,
- executeJavaScript
-
- Function to save as evidence the repositories used in the execution of the process:
-
- saveRepositoryAsEvidence.
-
- Function to handle the response of a message:
-
- assertion.
-
- Functions for keystroke handling:
-
- sendKeys,
- sendKeysCombination,
- sendKeysPaste
-
- waitFor function to wait for a certain period of time.
- takeScreenshot function to take a screenshot.
- ManualTast function: This function initiates the "manual intervention" process, which is a functionality that allows the user to perform and document test cases manually, generate evidence and upload the results to ALM. It is an aid to perform tests in an agile way in those cases where automation is not possible.
You have to declare them as a variable in H-TEST. When we finish executing this test case, we have as a result the evidence folder, where the log of the execution is stored. Path where the evidence folder is stored:This is an example of a UML Diagram which uses the User Object Adaptor: calculate the sum of 5 integers.
When run the case: 


