Skip to main content

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
      • getCurrentDateAsDate
      • getCurrentDateAsString

  • 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.


UserAdaptor1.0.png

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:

UserAdaptor2.png

 

 

UML Diagram and Mapping


UserAdaptor_blue.pngUserAdaptor.png

This is an example of interactions between the User Adaptor with other adaptors in an E2E test.

NECESITO IMAGEN

As part of the mapping process, you should provide the Adaptor’s information, regarding to connect and use it.

Test Set Execution

After the test set execution, immediately you have the results. There are two main elements you can verify:

  • Logs: the step by step information of the execution, with:
    • the results.
    • the methods had been executed.
    • the timelines.
  • Evidences: the screenshots or evidence information by step, in case they have requested.