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...)
 
Line 1: Line 1:
 
[[Categoría: Guías de GXtest]]
 
[[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ó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.
 
  
== Crear un Proc GX ==
+
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.  
Primero veremos cómo crear un ProcGX en Genexus para que quede expuesto como Web Service, y luego veremos cómo cargarlo en GXtest.
+
  
=== Definir un Procedimiento como Web Service en Genexus ===
+
== Creating a GX Proc ==
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.
+
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.  
  
Definición del procedimiento:
+
=== 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'''
 
'''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'''
 
'''Propiedades'''
Line 25: Line 26:
 
* 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.
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.
+

Revision as of 14:02, 27 November 2009

Categoría: Guías de GXtest


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

Propiedades

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