Creating a Custom Command

From GXtest Wiki
Revision as of 23:52, 30 November 2009 by Ftoledo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Categoría: GXtest Guides

Custom Commands give GXtest the flexibility to create new commands expressing action or validations to be performed in JavaScript language.

Creating a Custom Command

Open this menu to create Custom Command.

AccesoCustomCommand.jpg

The following screen will open where you can enter the JavaScript code to be run when the command is run:

CodigoCustomCommand.jpg

You need to choose a name, which will be used to reference it, and a description of the command.

Then you must choose the kind of command:

  • Action
  • Event
  • Validation

Then you need to choose for which versions of GeneXus the command is valid.

In the JS text box, a JavaScript template is displayed that must be respected in order to implement the command.

If the JavaScript function is implemented it is possible to consult values from currentGXVersion and currentLanguage if it is necessary that different actions are necessary depending on these parameters. Además se les puede pasar un parámetro en ParamJS.

You will recieve OK from the result variable if everything went well or an error message if it failed.

Using a Custom Command

Once you have created a Custom Command it is ready to be used by GXtest the same way as any other native command, allowing you to add it and edit it manually.

The only limiting factor is the fact that you can't record it automatically using the toolbar.