Difference between revisions of "GXtest Generator Tutorial"

From GXtest Wiki
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
| Tutorial de GXtest Generator
 
| Tutorial de GXtest Generator
 
| GXtest Generator Tutorial
 
| GXtest Generator Tutorial
| GXtest Generator Tutorial
+
| GXtest Generator チュートリアル
 
}}
 
}}
 
[[category:Guías de GXtest]]
 
[[category:Guías de GXtest]]
  
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.
+
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 [[Installation guide]] 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 [[Installation guide]])
+
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 25: 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 [[Generación automática: GXtest Generator#Opciones de Configuración]]), 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 [[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 [[Image:SelectObjects.png]], next to the project name.
 
Also, you can select a specific set of objects to be generated, clicking in the image [[Image:SelectObjects.png]], next to the project name.
Line 81: Line 81:
  
  
== Create a new test case ==
+
=== 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.
 
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.

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.