User Object Adaptor
Introduction
This adaptor is used to execute the flow information of the H-TEST execution process, by manipulating variables that are used to obtain and establish values in the adapters, as well as in decision making and loops.
Configuration
No information is established during initialization of the adaptor. It is by using the information of the predefined functions where it is performed.
Initialization Parameters
There are no Initialization Parameters.
Functions
-
assertion(stepResult,…): executes the JavaScript function using the variables that are introduces as input parameters and returns a boolean.
-
compareParameters(Element1, Element2): compares two values with an operator chosen by the user. Returns true or false.
-
compareScreens: compare html screenshot with 3270 host screenshot.
-
compareVariables(Name 1, Name 2): compares two variables with the operator chosen by the user. Returns true if they are equal.
-
copyFile(): this predefined function makes a copy of a file and move it to a new place. The input parameters are:
-
sourceFile, to enter the file you want to copy.
-
targetFile, to select where you want this file (it can be the same path). And
-
preserveFile, a Boolean, if “true” its marked it put the date of the file same as the original one.
If the names and the path of the original and the copy are the same, the name of the copy is changed for copy-“thenameoftheoriginal”.”ext”.
-
-
dateAddition: returns a date as a result of adding a number in the selected unit.
-
dateDifference: returns the difference between the dates in the selected unit. You need to select the date formats, both the first and second one, and input the first and second date in those formats. The last parameter is to select in which unit you want the time to be returned.
-
dateWeekDay: returns the day of the week in the specified format (number or literal).
-
executeCommand(): executes a command in Windows O.S. The aim of this PF is to execute commands in the local console. This is the reason because is located into the User Adaptor.
-
The Input parameter is the command itself. The command has to be preceded with the string “cmd /c”, for example:
“cmd /c dir /p” to list the files in a directory, or “cmd /c copy pathfileOrg pathfileDst” to copy one file to another.
-
-
executeCommandParam:
-
executeJavaScript(NameFunction): executes the javaScript function whose name is entered as a parameter. The function can 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 that returns will be saved in the output variable.
Javascript Version ECMAScript 5.
-
executeJmeter(PathTestPlan, PathResultFile): this is a function that runs a Jmeter test plan file, which stores the results in a .csv file in a location of your choice.
To download Jmeter, go to the “About H-TEST” tab at the top right of the H-TEST web application, and there you can find the download to this software. It has to be unzipped to “C:\appTAST\jmeter”, so that the final path is as follows: “C:\appTAST\jmeter\apache-jmeter-5.4.3”.
-
failTest(ErrorMsg): returns error with or without the error message that the user enters in the ErrorMsg parameter.
-
getCurrentDate(DateFormat): returns the current date with the established format or format by default in a parameter of type TASTDATATABE. To get: current date → TASDATATABLE [1]. Current day→ TASDATATABLE [2]. Current month→ TASDATATABLE [3]. Current year (yyyy) → TASDATATABLE [4]. Current year (yy) → TASDATATABLE [5].
-
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.