Difference between revisions of "Creating a Custom Command"

From GXtest Wiki
Jump to: navigation, search
(Using a Custom Command)
Line 31: Line 31:
  
 
The only limiting factor is the fact that you can't record it automatically using the toolbar.
 
The only limiting factor is the fact that you can't record it automatically using the toolbar.
 +
 +
== Useful suggestions ==

Revision as of 14:36, 12 April 2010


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.

Useful suggestions