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).
- getCurrentDate: returns the current date with the established format or format by default in a parameter of type TASTDATATABE.
- getCurrentDateAsDate: returns the current date as a Date type. Input parameters are not required.
- getCurrentDateAsString: 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.
This is an example of a UML Diagram which uses the User Object Adaptor: calculate the sum of 5 integers.
You have to declare them as a variable in H-TEST.
- setVariable(): Creates a variable whose name is entered as a parameter. The types of variables are: TastTableData, String, Integer, Double, Date or Boolean. We have declared five variables, type INTEGER and we have given a value to each one:
-
-
- Variable 1 = value 2
- Variable 2 = value 11
- Variable 3 = value 15
- Variable 4 = value 43
- Variable 5 = value 7
-
- executeJavaScript(NameFunction): Executes the javaScript function whose name is entered as a parameter. The function may have input parameters and return a value. The input parameters will be the variables defined with setVariable, or the results of other predefined functions. The value returned is stored in the output variable.
Capture of results
When we finish executing this test case, we see if it has been executed correctly:

We then open the icon on the right (marked with a red arrow) and we have as a result the evidence folder, where both the log of the execution is stored, as well as all the screenshots, files, etc... if we have checked the "Evidence" box in the general settings of the diagram.
When returning the results, H-TESTT returns a Word document, detailing the steps we have performed, the results obtained from each step, the links to the diagram and the test set, if we have clicked on download document in the Results box.


