Difference between revisions of "Creating a command to use a GeneXus Procedure"

From GXtest Wiki
Jump to: navigation, search
(Página nueva: Categoría: Guías de GXtest La invocación a Procedimientos Genexus desde los Test Cases de GXtest dan la posibilidad de ingresar validaciones a nivel de datos (implementando l...)
 
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Categoría: Guías de GXtest]]
+
{{Idiomas | Crear un Comando para invocación a un Procedimiento GeneXus | Creating a command to use a GeneXus Procedure | GeneXus のプロシージャーを使用するコマンドの作成}}
 +
[[Category: GXtest Guides]]
  
La invocación a Procedimientos Genexus desde los Test Cases de GXtest dan la posibilidad de ingresar validaciones a nivel de datos (implementando lógica Genexus para verificar que el estado en la base de datos es el que se esperaba) o para ejecutar cualquier tipo de acción o cálculo con programas Genexus. Estos pueden recibir cualquier cantidad de parámetros de entrada y salida.
+
Using a GeneXus Procedure from within a GXtest Test Case makes it possible to enter validation at the data level (implementing GeneXus logic to verify the expected state of a database) or to run whatever kind of action or calculation with GeneXus programs. They can have any number of input and output parameters.  
  
== Crear un Proc GX ==
+
== Creating a GX Proc ==
Primero veremos cómo crear un ProcGX en Genexus para que quede expuesto como Web Service, y luego veremos cómo cargarlo en GXtest.
+
First you’ll see how to create a GX Proc in GeneXus so that it is exposed as a Web Service and then how to load it into GXtest.  
  
=== Definir un Procedimiento como Web Service en Genexus ===
+
=== Defining a Procedure as a GeneXus Web Service ===
Veamos a modo de ejemplo la creación de un procedimiento de suma. Este nos serviría para tener en GXtest la posibilidad de sumar dos números en un Test Case.
+
Here is an example of how to create an addition procedure. This can be used to have GXtest add together two numbers in a Test Case.  
  
Definición del procedimiento:
+
Definition of the procedure:  
  
 
'''Rules'''
 
'''Rules'''
  Parm(in:&NroA, in:&NroB,
+
  Parm(in:&NumA, in:&NumB,
       out:&ResultadoSuma,out:&OtraVariable);
+
       out:&ResultSum,out:&OtherVariable);
  
En este ejemplo tendremos dos salidas, el resultado de la suma y otro valor cualquiera, sólo para mostrar que se pueden manejar varios parámetros de salida a nivel de GXtest.
+
In the example there are two outputs, the result of the addition and another value, which are included only to show that it is possible to manage several output parameters at the GXtest level.  
  
 
'''Source'''
 
'''Source'''
  &ResultadoSuma = &NroA+&NroB
+
  &ResultSum = &NumA+&NumB
  &OtraVariable = 4
+
  &OtherVariable = 4
  
'''Propiedades'''
+
'''Properties'''
 
* Call Protocol: SOAP
 
* Call Protocol: SOAP
 
* Main Program: True
 
* Main Program: True
  
=== Cargar el Procedimiento en GXtest ===
+
=== Loading the Procedure into GXtest ===
  
Acceder al menú para crear un Proc GX.
+
Open the menu to create the GX Proc.
  
 
[[image:AccesoProcGX.jpg]]
 
[[image:AccesoProcGX.jpg]]
  
 
+
Then click on Add GX Proc that will bring up a window where you can load the GeneXus Procedure:  
Luego, haciendo clic en '''Add Prog GX''', se le presenta la siguiente pantalla al usuario donde se puede cargar el Procedimiento Genexus:
+
  
 
[[image:definirProcGX.jpg]]
 
[[image:definirProcGX.jpg]]
  
 +
Here you can enter the URL to the GeneXus Procedure’s WSDL and click [[image:botonRefresh.jpg]].
  
Ahí se debe indicar la URL al WSDL del Procedimiento Genexus y presionar [[image:botonRefresh.jpg]].
+
Once done it will have loaded the procedure's definition and you can see then name and the input and output parameters for the procedure. In the addition example you can see in the following image how the parameters are displayed.  
 
+
Al hacer esto se carga la definición del procedimiento y ahi podemos visualizar el nombre del procedimiento y los parámetros de entrada y salida. En el ejemplo de la suma veríamos los parámetros como se muestran a continuación:
+
  
 
[[image:procSuma.jpg]]
 
[[image:procSuma.jpg]]
  
 +
Here you can edit the name that will refer to the command, the description and whether you will use Action or Validation.
  
Ahí se puede editar el nombre con el cual se va a referenciar luego el comando, la descripción, y si lo utilizaremos como ''Acción'' o ''Validación''.
+
== Using a GX Proc ==
 
+
Once you have created the GX Proc 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.  
== Usar un Proc GX ==
+
Una vez que se crea un Proc GX este queda disponible en GXtest de la misma forma que cualquier comando nativo, permitiendo agregarlos y editarlos en forma manual.
+
  
 
[[image:usarProgGX.jpg]]
 
[[image:usarProgGX.jpg]]
  
 +
Note that you can load the output parameters into variables and the input parameters can be come from a variable, fixed values and Data Pools.
 +
 +
== Adding procedures used like validations ==
 +
Sometimes you need to use a GX Procedure to evaluate a condition in your database.
 +
This kind of procedures, could only have one output value: The True/False response.
 +
 +
 +
This output could be "T" for True conditions, and any other string, to False ones.
 +
 +
For example:
  
Observar que los parámetros de salida se pueden cargar en variables, y los de entrada pueden tomar tanto variables, valores fijos o tomados de DataPools.
+
If you build a procedure named ExistClient (in: idClient)
 +
The returned value "T" will mean that client with id = idClient exist, otherwise, you can return a text like "The client doesn't exists", and GXtest will assume that is a False response.

Latest revision as of 19:52, 20 February 2014

Spanish.gif
English.gif
Japan.gif

Using a GeneXus Procedure from within a GXtest Test Case makes it possible to enter validation at the data level (implementing GeneXus logic to verify the expected state of a database) or to run whatever kind of action or calculation with GeneXus programs. They can have any number of input and output parameters.

Contents

Creating a GX Proc

First you’ll see how to create a GX Proc in GeneXus so that it is exposed as a Web Service and then how to load it into GXtest.

Defining a Procedure as a GeneXus Web Service

Here is an example of how to create an addition procedure. This can be used to have GXtest add together two numbers in a Test Case.

Definition of the procedure:

Rules

Parm(in:&NumA, in:&NumB,
     out:&ResultSum,out:&OtherVariable);

In the example there are two outputs, the result of the addition and another value, which are included only to show that it is possible to manage several output parameters at the GXtest level.

Source

&ResultSum = &NumA+&NumB
&OtherVariable = 4

Properties

  • Call Protocol: SOAP
  • Main Program: True

Loading the Procedure into GXtest

Open the menu to create the GX Proc.

AccesoProcGX.jpg

Then click on Add GX Proc that will bring up a window where you can load the GeneXus Procedure:

DefinirProcGX.jpg

Here you can enter the URL to the GeneXus Procedure’s WSDL and click BotonRefresh.jpg.

Once done it will have loaded the procedure's definition and you can see then name and the input and output parameters for the procedure. In the addition example you can see in the following image how the parameters are displayed.

ProcSuma.jpg

Here you can edit the name that will refer to the command, the description and whether you will use Action or Validation.

Using a GX Proc

Once you have created the GX Proc 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.

UsarProgGX.jpg

Note that you can load the output parameters into variables and the input parameters can be come from a variable, fixed values and Data Pools.

Adding procedures used like validations

Sometimes you need to use a GX Procedure to evaluate a condition in your database. This kind of procedures, could only have one output value: The True/False response.


This output could be "T" for True conditions, and any other string, to False ones.

For example:

If you build a procedure named ExistClient (in: idClient) The returned value "T" will mean that client with id = idClient exist, otherwise, you can return a text like "The client doesn't exists", and GXtest will assume that is a False response.