Difference between revisions of "GXtest Commands"
(Created page with "{{Idiomas |Comandos de GXtest |GXtest Commands }} category:GXtest Guides Category:GXtest Commands <- Previous | GXtest Designer 2.0 User's Manual|...") |
(→Command list) |
||
Line 56: | Line 56: | ||
== Command list == | == Command list == | ||
− | A list of all GXtest commands can be found in [[Command List | + | A list of all GXtest commands can be found in [[Command List|this page]] |
Revision as of 18:58, 10 October 2013
Contents |
6. Commands
Commands allow you to express the interactions that you want an application to perform as well as validations of the expected state of an application after each of the interactions. Commands can be actions, validations and events. Each of these can have parameters that indicate when they should run within an application.
Actions are done by a user within a webpage and don’t move you to another page. Some examples of actions are FillInput (to insert a value into a field on the page) and Check (to tick a checkbox).
There are also events that are interactions that cause you to move from one page to another. Some example of events are Go (the same as typing a URL into a browser), ClickLink (used to click a link within a page) and ClickButton (used to click a specific button).
Lastly there are validations which are used to validate that the resulting state of an application is what was expected. Some examples of validations are AppearText (checks if a text is present or not) or VerifyControlText (compares the value of a control on the screen with a reference value). Validations always have two mandatory parameters in addition to their other parameters.
- Error Description Parameter: this is shown if a validation fails and describe why the failure occurred.
- Negation Description Parameter: this shows that the expected result is the negation of the validation. For example if you negate the validation AppearText it says that you don’t want a certain text to appear.
Parameters
Each command recieves a list of parameters. The kinds of parameters that a command can have are described below:
Control Parameter
This kind of parameter is used to create a control within a GeneXus object. Transaction and WebPanel objects in GeneXus have an associated WebForm, this WebForm has an associated set of controls that specify the information to be shown and the interaction that the user can have with the object. For example, a button or a field where you can enter values are controls within a WebForm object.
Value Parameter
Value parameters refer to a fixed value, be it text or a number, that you want to use in a command.
Variable Parameter
GXtest allows you to capture values returned by an application and store them as variables. These variables are then used in other commands. (See Creating a Test Case with Variables for more information.) There is a standard variable called urlHome that uses the value defined in the project’s URL property when the Test Case is ran with GXtest Designer or that uses the value defined by the URL property associated with the task when it is run with GXtest Manager.
Data Pool Parameter
Data Pools allow you to use external data in a Test Case. Data Pool parameters allow you to tell a command to take values from a specific data source.
SelectionByRow Parameter
Commands that are run within tables have a parameter the tells them which row within a table they should use to run an action. This parameter referred to generically as SelectionRule can actually be two types SelectionByRow or SelectionByControl. SelectionByRow is used to specify the row where the action will take place and is indicated by the row number. In this way you can model in GXtest actions such as “Click on the first row of the grid.” Because of this the parameter has a Data Pool subparameter, value or variable. This parameter can be a positive number which indicates the row (where the first row is referenced by number 1). If you want to select the last row you can use the keyword "last" instead of a number.
SelectionByControl Parameter
The SelectionByControl parameter is used to specify the row in table to be used based on a value in one of its columns. For example you can tell GXtest to select the row which contains Employee Number 59. GXtest will search the table and select the row with the first instance that matches the established criteria. This parameter has two subparameters:
- Control Type Parameter indicates the column where GXtest will begin to search for the established criteria
- Type of Comparison and comparer indicates if what is to be compared is text or a number and the comparison that will be used (equal to, more then, less than, contains, etc.)
- Variable Type Parameter, Data Pool or Value: it’s the value that is going to be compared.
Custom Commands
Sometimes extra features are developed to improve the user interface, using Javascripts or HTML by hand. In those cases GXtest it is not going to recognice the commands over these controls, and it is necessary that the user prepare his own GXtest commands. To do that you can use "Custom Commands". To learn more about it check Creating a Custom Command.
Use a command to invoke a Genexus Procedure
Many times it is very useful to invoke a Genexus Procedure to manage data or validations over that data. To learn more about it check Creating a command to use a GeneXus Procedure.
Command list
A list of all GXtest commands can be found in this page
Back to Index