Difference between revisions of "GXtest Generator Tutorial"

From GXtest Wiki
Jump to: navigation, search
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Idiomas
 +
| Tutorial de GXtest Generator
 +
| GXtest Generator Tutorial
 +
| GXtest Generator チュートリアル
 +
}}
 
[[category:Guías de GXtest]]
 
[[category:Guías de GXtest]]
  
In order to start automating with GXTest, Para empezar a automatizar con GXtest, a point to make is that it is possible to initialise the project as well as the KB in an automatic manner.
+
In order to start automating with GXtest, a point to make is that it is possible to initialise the project as well as the KB in an automatic manner.
Employing the GXTest Generator's extension for Genexus (which must be version Evolution 1 or greater), some tools will become available which will be useful whilst working with the KB and GXTest from Genexus itself.
+
Employing the GXtest Generator's extension for Genexus (which must be version Evolution 1 or greater), some tools will become available which will be useful whilst working with the KB and GXTest from GeneXus itself.
  
GXTest Generator aids you through the beginning of tests automation with GXTest, automatically generating test cases and initialising the work environment for GXTest.
+
GXtest Generator aids you through the beginning of tests automation with GXTest, automatically generating test cases and initialising the work environment for GXtest.
  
Provided the extension is not yet installed in Genexus, you can either check step 3 from [[Guias_de_Instalacion]] in GXTest, or download the extension from [http://marketplace.genexus.com/product.aspx?gxtestextension GeneXus Marketplace].
+
Provided the extension is not yet installed in GeneXus, you can either check step 3 from [[Installation guide]] in GXtest, or download the extension from [http://marketplace.genexus.com/product.aspx?gxtestextension GeneXus Marketplace].
  
So that you can go through this tutorial, GXTest Designer must be installed in your system (Check [[Guias_de_Instalacion]])
+
So that you can go through this tutorial, GXtest Designer must be installed in your system (Check [[Installation guide]])
 
In the examples below the following KB is employed [[http://open.genexusserver.com/xev1/home.aspx?AjaxSample AjaxSample]] from the samples by GeneXus.
 
In the examples below the following KB is employed [[http://open.genexusserver.com/xev1/home.aspx?AjaxSample AjaxSample]] from the samples by GeneXus.
  
Line 14: Line 19:
 
== Step 1: Automatic Initialization  ==  
 
== Step 1: Automatic Initialization  ==  
  
While opening GeneXus, a new menu labeled GXTest will be displayed which, will have an item for Autogenerate TestCases. That menu option will open up the window for automatic generation from GCTest Generator.
+
While opening GeneXus, a new menu labeled GXTest will be displayed which, will have an item for Autogenerate TestCases. That menu option will open up the window for automatic generation from GXTest Generator.
  
 
[[Image:GXMenuGXtest.png|center]]
 
[[Image:GXMenuGXtest.png|center]]
Line 20: Line 25:
 
In that location it's where the information for testing associated to the KB that is opened will be displayed, and also, the button to start the process for Generate tests will be available.
 
In that location it's where the information for testing associated to the KB that is opened will be displayed, and also, the button to start the process for Generate tests will be available.
  
 +
Should it be necessary, before starting with the generation of test cases, it is possible to set the options that the extension provides (Refer to [[GXtest Generator User Manual#Configuration Options]]), nonetheless, the default options will now suffice.
  
Should it be necessary, before starting with the generation of test cases, it is possible to set the options that the extension provides (Refer to [[Generación automática: GXtest Generator#Opciones de Configuración]]), nonetheless, the default options will now suffice.
+
Also, you can select a specific set of objects to be generated, clicking in the image [[Image:SelectObjects.png]], next to the project name.
  
 
+
Clicking on the button will start the process for automatic generation, and the progress will be displayed on screen.
Clicking on the button, will start the process for automatic generation, and the progress will be displayed on screen.
+
Once the process is completed, a project will be created in GXTest with its corresponding KB, and it will import all of the automatically generated test cases.
Once the process is completed, a project will be created in GXTest with its corresponding KB, and it will import all of the automatically generated test cases.e.
+
  
 
The automatically generated test cases cover two types of tests:
 
The automatically generated test cases cover two types of tests:
 
* For every transaction, a test case will be generated which will test from an entity its creation, search, visualisation, update and delete.
 
* For every transaction, a test case will be generated which will test from an entity its creation, search, visualisation, update and delete.
For examplo, in case I happened to have a transaction Product in the KB, a set of test cases would be automatically generated following this workflow:
+
For example, in case I happened to have a transaction Product in the KB, a set of test cases would be automatically generated following this workflow:
  
  
Line 35: Line 40:
  
  
* Para cada WebPanel que no sea autogenerado(*) se generará un caso de prueba básico que ingrese valores en todos los campos editables y presione los botones.
+
* For every WebPanel that is not self-generated(*), a basic test case will be generated insert input values in all of the editable fields, as well as pressing all of the buttons.
  
(*) Los webpanels autogenerados son los que genera GeneXus de forma automática. Un ejemplo de esto son los prompts y las pantallas de los patrones WorkWith.
+
(*) The self-generated webpanels are those which are generated by GeneXus in an automatic manner. An example for this concept are prompts and the screens of the WorkWith patterns.
  
Puede visitar [[Manual de Usuario de GXtest Generator]] para ver más información sobre la generación automática.
+
Should you look for further information about automatic generation of test, then please visit [[GXtest Generator User Manual]].
  
== Paso 2: Ejecución de las pruebas generadas ==
+
== Step 2: Execution of the generated tests ==
  
Terminada la generación automática, se puede ver en GXtest Designer el proyecto y los casos de prueba generados.
+
Once the automatic generation is completed, in GXTest Designer the project can be seen, as well as the test cases which were generated.
Luego de abrir GXtest Designer, abrir el proyecto en Project -> Open Project, y seleccionar el proyecto generado con el nombre de la KB y el sufijo "_Auto".
+
After opening GXTest Designer, proceed to open the project by going to 'Project -> Open Project', then selecting the generated project with the name of the KB and its suffix "_Auto".
Por ejemplo, para la KB AjaxSample, el nombre del proyecto generado de manera automáticamente será AjaxSample_Auto.
+
For example, for the AjaxSample KB, the name of the automatically generated project will be AjaxSample_Auto.
  
En el árbol de la derecha es posible ver los casos de prueba generados e importados.
+
In the tree from the right the generated test cases, as well as those which were imported can be seen:
  
 
  [[Image: Tctree.PNG|center]]
 
  [[Image: Tctree.PNG|center]]
  
  
Todo esto se generó de manera automática a partir del clic realizado en GeneXus.
+
Everything has been generated in an automatic manner starting by the click performed in GeneXus.
  
En la KB de ejemplo que se utilizó (AjaxSample), las entidades para las que se generaron las pruebas son City, Client, Country, Invoice y Product.
+
In the KB employed for the example (AjaxSample), the entities for which test cases we generated are City, Client, Country, Invoice and Product.
Para cada una de estas entidades, se creó un caso de prueba principal (por ejemplo City), y otros casos de prueba secundarios que realizan las diferentes operaciones (Creación: City_Insert, Eliminación: City_Delete, etc), los cuales son utilizados por el primero.
+
For every single one of those entities, a main test case was created (for example City), as well as other secondary test cases which perform several other operations (such as 'Creation': City_Insert, 'Deletion': City_Delete, etc.), the latter tests are employed by the former one.
  
Este es un ejemplo de como se vería un caso de prueba City (Crea, busca, visualiza, modificar, y elimina una Ciudad).
+
This example portrays what a test case for City would look like (it creates, searches, visualizes, modifies and deletes a City).
  
 
  [[Image: TCMain.PNG|center]]
 
  [[Image: TCMain.PNG|center]]
  
  
Con el Test Case abierto, podemos ejecutarlo en el navegador, presionando el botón ejecutar (o Shift F5) que se encuentra en la barra de herramientas:
+
Having the test case opened, we can run it from the browser itself, by clicking the Run button (or Shift + F5) which can be found in the tools bar:
  
 
[[Image:ejecutar.JPG|center]]
 
[[Image:ejecutar.JPG|center]]
  
Esto provocará que se abra el navegador, y se comiencen a ejecutar las acciones que contiene la definición de la prueba.  
+
That action will trigger the opening of the browser, as well as the beginning of the execution of actions contained in the tests' definition.
 
+
En la siguiente imagen se muestran en GXtest los resultados de la prueba:
+
  
 +
In the following image are displayed what the results of the tests look like in GXTest:
  
 
[[Image: resultadosVerCliente.JPG|center]]
 
[[Image: resultadosVerCliente.JPG|center]]
  
  
== Paso 3: Agregar o modificar los datos ==  
+
== Step 3: Adding or Updating the Data ==  
  
  
== Crear un nuevo caso de prueba ==
+
=== Create a new test case ===
  
A partir de aquí se tiene el entorno de trabajo de GXtest inicializado, y es posible seguir agregando nuevos casos de prueba o reutilizando los ya creados.
+
From this point onwards the work environment for GXTest is initialised, however, it is still possible keep on adding new test cases or reusing the already created ones.
  
Por ejemplo, puede ser interesante crear un caso de prueba mas complejo que genere un nuevo producto, luego un nuevo cliente, una factura para ese cliente y ese producto, y luego intentar borrar el cliente.
+
For example, it can be interesting to create a more complex test case which generates a new product, then a new client, a new billing for that client and that product, and then tries to delete the client.
  
 
[[Image:TCComplejoAuto.png|center]]
 
[[Image:TCComplejoAuto.png|center]]
  
  
Si quisiera generar este caso de prueba complejo, puedo reutilizar los casos de prueba ya generados de forma automática para cada uno de esos pasos, e incluirlos en un único caso de prueba.
+
In the event we wanted to generate that complex test case, the test cases which were automatically generated can be reused for each of those steps, and can be included in a single test case.
  
 
[[Image:TCComplejoAuto_GXtest.png|center]]
 
[[Image:TCComplejoAuto_GXtest.png|center]]
  
  
Para esto, puede crear un nuevo caso de prueba en el menú "Test Cases" -> New. Luego ingresar el nombre del caso de prueba, por ejemplo "Factura".  
+
To accomplish that, a new test case can be created from the menu by going to 'Test Cases -> New'. Then, type the name for the test case, for instance, "Billing".  
Para incluir los casos de prueba ya generados y utilizarlos dentro de "Factura", puede arrastrar de la barra de objetos un caso de prueba al nuevo caso de prueba en blanco.
+
In order to include the already generated test cases and employ them in "Billing", from the objects bar a test case may be dragged and dropped onto the new test case.
  
 
[[Image:ToolboxGXtest.png|center]]
 
[[Image:ToolboxGXtest.png|center]]
  
  
Aparecerá una ventana para seleccionar el caso de prueba que se desea incluir. Escribir Client_Insert en el filtro y seleccionarlo cuando aparezca en la grilla. Realizar lo mismo con el resto de los casos de prueba (Product_Insert, etc).
+
A window pop-up will be displayed to select the test case which is to be included. In the filer type Client_Insert, once it is displayed in the grid, have it selected. Follow the same set of steps with the remaining test cases (Product_Insert, etc).
  
Por último, es necesario conectarlos con aristas de forma de completar el flujo mostrado en el ejemplo.
+
Lastly, it is necessary to connect them by its edges so that to complete the workflow displayed in the example.
  
Listo. El caso de prueba está listo para ser ejecutado.
+
Done! The test case is all set for running it.
  
  
== Como seguir? ==
+
== How should I follow? ==
  
Es recomendable continuar el tutorial en [[Empezando con GXtest]] para completar el proyecto, y por ejemplo grabar un caso de prueba utilizando el navegador.
+
It is our piece of advice that you take up the tutorial available at [[Starting out with GXtest]] so that the project can be completed, and for instance, a test case can be created by recording it from the browser.

Latest revision as of 17:06, 15 May 2014

Spanish.gif
English.gif
Japan.gif

In order to start automating with GXtest, a point to make is that it is possible to initialise the project as well as the KB in an automatic manner. Employing the GXtest Generator's extension for Genexus (which must be version Evolution 1 or greater), some tools will become available which will be useful whilst working with the KB and GXTest from GeneXus itself.

GXtest Generator aids you through the beginning of tests automation with GXTest, automatically generating test cases and initialising the work environment for GXtest.

Provided the extension is not yet installed in GeneXus, you can either check step 3 from Installation guide in GXtest, or download the extension from GeneXus Marketplace.

So that you can go through this tutorial, GXtest Designer must be installed in your system (Check Installation guide) In the examples below the following KB is employed [AjaxSample] from the samples by GeneXus.


Contents

Step 1: Automatic Initialization

While opening GeneXus, a new menu labeled GXTest will be displayed which, will have an item for Autogenerate TestCases. That menu option will open up the window for automatic generation from GXTest Generator.

GXMenuGXtest.png

In that location it's where the information for testing associated to the KB that is opened will be displayed, and also, the button to start the process for Generate tests will be available.

Should it be necessary, before starting with the generation of test cases, it is possible to set the options that the extension provides (Refer to GXtest Generator User Manual#Configuration Options), nonetheless, the default options will now suffice.

Also, you can select a specific set of objects to be generated, clicking in the image SelectObjects.png, next to the project name.

Clicking on the button will start the process for automatic generation, and the progress will be displayed on screen. Once the process is completed, a project will be created in GXTest with its corresponding KB, and it will import all of the automatically generated test cases.

The automatically generated test cases cover two types of tests:

  • For every transaction, a test case will be generated which will test from an entity its creation, search, visualisation, update and delete.

For example, in case I happened to have a transaction Product in the KB, a set of test cases would be automatically generated following this workflow:


EjemploTCauto.png


  • For every WebPanel that is not self-generated(*), a basic test case will be generated insert input values in all of the editable fields, as well as pressing all of the buttons.

(*) The self-generated webpanels are those which are generated by GeneXus in an automatic manner. An example for this concept are prompts and the screens of the WorkWith patterns.

Should you look for further information about automatic generation of test, then please visit GXtest Generator User Manual.

Step 2: Execution of the generated tests

Once the automatic generation is completed, in GXTest Designer the project can be seen, as well as the test cases which were generated. After opening GXTest Designer, proceed to open the project by going to 'Project -> Open Project', then selecting the generated project with the name of the KB and its suffix "_Auto". For example, for the AjaxSample KB, the name of the automatically generated project will be AjaxSample_Auto.

In the tree from the right the generated test cases, as well as those which were imported can be seen:

Tctree.PNG


Everything has been generated in an automatic manner starting by the click performed in GeneXus.

In the KB employed for the example (AjaxSample), the entities for which test cases we generated are City, Client, Country, Invoice and Product. For every single one of those entities, a main test case was created (for example City), as well as other secondary test cases which perform several other operations (such as 'Creation': City_Insert, 'Deletion': City_Delete, etc.), the latter tests are employed by the former one.

This example portrays what a test case for City would look like (it creates, searches, visualizes, modifies and deletes a City).

TCMain.PNG


Having the test case opened, we can run it from the browser itself, by clicking the Run button (or Shift + F5) which can be found in the tools bar:

Ejecutar.JPG

That action will trigger the opening of the browser, as well as the beginning of the execution of actions contained in the tests' definition.

In the following image are displayed what the results of the tests look like in GXTest:

ResultadosVerCliente.JPG


Step 3: Adding or Updating the Data

Create a new test case

From this point onwards the work environment for GXTest is initialised, however, it is still possible keep on adding new test cases or reusing the already created ones.

For example, it can be interesting to create a more complex test case which generates a new product, then a new client, a new billing for that client and that product, and then tries to delete the client.

TCComplejoAuto.png


In the event we wanted to generate that complex test case, the test cases which were automatically generated can be reused for each of those steps, and can be included in a single test case.

TCComplejoAuto GXtest.png


To accomplish that, a new test case can be created from the menu by going to 'Test Cases -> New'. Then, type the name for the test case, for instance, "Billing". In order to include the already generated test cases and employ them in "Billing", from the objects bar a test case may be dragged and dropped onto the new test case.

ToolboxGXtest.png


A window pop-up will be displayed to select the test case which is to be included. In the filer type Client_Insert, once it is displayed in the grid, have it selected. Follow the same set of steps with the remaining test cases (Product_Insert, etc).

Lastly, it is necessary to connect them by its edges so that to complete the workflow displayed in the example.

Done! The test case is all set for running it.


How should I follow?

It is our piece of advice that you take up the tutorial available at Starting out with GXtest so that the project can be completed, and for instance, a test case can be created by recording it from the browser.