Difference between revisions of "Creating a Test Case with Datapools"

From GXtest Wiki
Jump to: navigation, search
(Página nueva: __NOTOC__ category:GXtest Guides Usualmente es necesario variar los datos que utiliza el caso de prueba. Para esto en GXtest se utilizan los DataPools. En esta ocasión veremos ...)
 
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
{{Idiomas| Crear un Caso de Prueba con Datapools| Creating a Test Case with Datapools| データプールを使用するテストケースの作成}}
 
__NOTOC__
 
__NOTOC__
 
[[category:GXtest Guides]]
 
[[category:GXtest Guides]]
  
 +
It is usually necessary to vary somewhat the data that a Test Case uses. To do so GXtest uses Data Pools. Here you will learn how to create a Test Case that uses a Data Pool.
  
Usualmente es necesario variar los datos que utiliza el caso de prueba. Para esto en GXtest se utilizan los DataPools. En esta ocasión veremos como crear un caso de prueba que utilice un DataPool.  
+
In this tutorial you will construct a Test case called SeeClientWithDataPool which will use a Data Pool that contains a list of clients. The Test Case will take each of the clients and enter them into a page where they can be viewed.  
  
En este ejemplo se construirá el caso de prueba ''VerClienteConDataPool'', dicho caso de prueba utiliza un DataPool que contiene una lista de clientes. El caso de prueba irá tomando cada uno de los clientes y entrará a la página donde se visualizará dicho cliente.
 
  
== Paso 1: Crear el caso de Prueba ==
+
== Step 1: Creating the Test Case ==
Para comenzar hay que seguir los pasos descritos en la página [[Empezando con GXtest]], la única diferencia es que al crear el caso de prueba se le debe de poner el nombre de VerClienteConDataPool.
+
  
== Paso 2: Crear el DataPool ==
+
To begin you will need to follow the steps described in the page [[Starting out with GXtest]], the only difference being that when you create the Test Case you should enter the name as SeeClientWithDataPool.
Luego que seguimos estos pasos tenemos el caso de prueba que visualiza siempre el cliente Abstracta. Para poder lograr que se visualice más de un cliente debemos crear el datapool ''Clientes''.
+
Para esto hacemos clic con el botón derecho sobre el nodo DataPools que se encuentra en el panel de la derecha y seleccionar ''Create New DataPool'' como se muestra en la siguiente figura:
+
[[Imagen:addDataPool.jpg|center]]
+
  
Luego ingresamos el nombre (Clientes en este caso), una descripción y presionamos Ok.
+
== Step 2: Creating the Data Pool ==
[[Imagen:createNewDataPool.jpg |center]]
+
After following these steps you should have a Test Case that always shows the client Abstracta. In order to view more than one client you must create the Clients Data Pool. To do so right click on the Data Pools node in the right-hand panel and select Create New Data Pool as shown in the following figure:
  
Nos aparece una ventana que notifica que se ha creado satisfactoriamente y nos da la posibilidad de definir las columnas que va a tener dicho datapool. En este caso va a tener una única columna denominada nombre.
+
[[Image:addDataPool.jpg|center]]
  
 +
Then enter the name (Clients in this case), a description and click Ok.
  
[[Imagen:createNewDataPool2.jpg |center]]
+
[[Image:createNewDataPool.jpg |center]]
  
Presionamos Save y queda dado de alta el nuevo datapool y automáticamente se abre para poder ingresarle datos.
+
A window appears telling you that the Data Pool was successfully created and you choose the number of columns it will have. For this example you will only have one column called Name.
== Paso 3: Ingresar datos al DataPool ==
+
En esta ocasión vamos a ingresar tres datos: Abstracta, Artech y Artech ss.
+
  
[[Imagen: DatosDataPool.jpg |center]]
+
[[Image:createNewDataPool2.jpg |center]]
  
Luego se presiona Save para que sean dados de alta dichos datos.
+
Click save and it will open so that you can begin to enter data.
  
== Paso 4: Asociar al caso de prueba el DataPool ==
 
A esta altura tenemos por un lado el caso de prueba y por otro lado el datapool Clientes, lo que tenemos que hacer ahora es relacionar ambos conceptos, o sea indicar en el caso de prueba que se utilicen los datos del datapool.
 
Para esto seleccionamos el nodo Work With Clients. Si observamos en la parte de abajo aparece un panel llamado '''Work With Clients commands''', en donde se puede ver un comando FillInput que utiliza el valor 'abstracta', ese valor es el que hay que reemplazar por el datapool Clientes. Para esto hacemos clic con el botón derecho sobre el comando FillInput y presionamos ''Edit Command'' tal como se muestra en la siguiente pantalla.
 
  
[[Imagen: editCommandMenu.jpg |center]]
+
Note: The maximum number of columns that a DataPool can have is 99.
  
En ese momento se nos abre una ventana que nos permite editar el comando. Si nos fijamos en la misma aparecen los parámetros que recibe el comando FillInput. Uno de  ellos es de tipo Value y tiene como contenido 'abstracta'.
+
== Step 3: Entering data into the Data Pool ==
 +
Here you will enter three pieces of data: Abstracta, Artech and another.  
  
[[Imagen: editingCommandValue.jpg |center]]
+
[[Image: DatosDataPool.jpg |center]]
  
Lo que debemos hacer es indicar que el parámetro es de tipo DataPool y seleccionar el datapool creado previamente. En la figura siguiente se muestra como debería quedar.
+
Then click Save to save the data.  
  
 +
== Step 4: Associating the Test Case with the Data Pool ==
 +
Now that you have the Test Case and the Clients Data Pool ready you need to relate the two concepts by telling the Test Case to use the data from the Data Pool. To do this select the Work With Clients node. If you look in the lower part of the screen there is a panel called Work With Clients commands where you can see the command FillInput that has the value “abstracta”. This value will be replaced by the Data Pool Clients. Right click on the FillInput command and select Edit Command as seen in the image.
  
[[Imagen: editingCommandDataPool.jpg |center]]
+
[[Image:editCommandMenu.jpg|center]]
  
Luego presionamos el botón OK para guardar los cambios.
+
A window will then open that allows you to edit the command. In this window are the parameters for the FillInput command. One of these is Value and has “abstracta” entered into it.  
  
Listo este nodo quedó finalizada. Sin embargo si recordamos, la arista que va desde la página Work With Clients a Abstracta tiene una validación que controla que aparezca al nombre Abstracta en la pantalla.
+
[[Image:editingCommandValue.jpg|center]]
Por este motivo debemos seguir el mismo procedimiento para el comando AppearText que se encuentra en la arista ClickTable que va desde la página Work With Clients a Abstracta.
+
Para que el caso de prueba quede mas claro es conveniente cambiar el nombre de la última página y ponerle en ves de Abstracta por ejemplo View Client. Para esto basta con hacer doble clic cobre la página y cambiarle el nombre.
+
  
Por último se y esto es '''MUY IMPORTANTE''' se debe indicar a GXtest cuando avanzar a la próxima fila del DataPool, para eso se debe agregar un comando del tipo DPNext al inicio del caso de prueba.
+
In this parameter you need to select that it is a Data Pool and then choose the Clients Data Pool. This figure show how it should look:  
Parea esto hacer clic con el botón derecho arriba de la arista Go presionar Add Command. Luego seleccionar en la ventana que aparece, en el primer combo indicar que es una acción y en el segundo indicar que es la acción DPNext, tal como se muestra a continuación:<br>
+
[[Image:addDPNext.jpg]]
+
En dicha ventana indicar en los parámetros del comando que se avance el DataPool Clientes. El comando debe quedar como se muestra en la ventana anterior.
+
  
Quedó listo el caso de prueba parametrizado, ahora hay que probarlo.
+
[[Image:editingCommandDataPool.jpg|center]]
  
== Paso 5: Ejecutar el caso de prueba==
+
Then click OK to save the changes.
Para probarlo presionamos el botón Run N (o Shift+F7).
+
 
 +
The node is now finished. Remember that the edge line that goes from Work With Clients to Abstracta has a validation that controls for the appearance of the name Abstracta on the screen. Therefore you should follow the same procedure for the AppearText Command that is found on the ClickTable Edge Line that goes from Work With Clients to Abstracta. It is a good idea to change the name of the last page from Abstracta to View Client so that it is more clear. Just right click on the page and change the name.
 +
 +
Lastly and most importantly you need to tell GXtest when to move to the next row of the Data Pool which is done by adding the DPNext command to the beginning of the test case. To do so, right click on the Go Edge Line and then click Add Command. Then select Action from the first combobox and DPNext from the second as seen here:
 +
 
 +
[[Image:addDPNext.jpg|center]]
 +
 
 +
In this window you specify the command parameter that the Data Pool Clients should follow. The model ought to look like the previous window.
 +
 
 +
The Test Case parameters are now ready and you just need to run it.
 +
 
 +
== Step 5: Running the Test Case ==
 +
To run the Test Case click the Run N button or Shift+F7.  
  
 
[[Image:BotonEjecutarN.jpg|center]]
 
[[Image:BotonEjecutarN.jpg|center]]
  
Luego indicamos que se ejecute 3 veces.
+
Then tell it to run 3 times
  
[[Imagen:ChooseNWindow.jpg|center]]
+
[[Image:ChooseNWindow.jpg|center]]
  
Se abrirá un navegador y se ejecutará con el dato Abstracta, luego al terminar se abrirá otro y se ejecutará con el dato Artech y para finalizar se abrirá el tercero y se ejecutará con el dato Artech ss.
+
This will open a new browser and it will be run with Abstracta, then again with Artech and once again with Artech ss.
  
== Véase también ==
+
== See also ==
* [[Crear un Caso de Prueba con Bifurcación]]
+
* [[Creating a Test Case with Bifurcation]]
* [[Crear un Caso de Prueba Anidado]]
+
* [[Creating an Embedded Test Case]]
* [[Crear un Caso de Prueba con Variables]]
+
* [[Creating a Test Case with Variables]]

Latest revision as of 20:44, 20 February 2014

Spanish.gif
English.gif
Japan.gif

It is usually necessary to vary somewhat the data that a Test Case uses. To do so GXtest uses Data Pools. Here you will learn how to create a Test Case that uses a Data Pool.

In this tutorial you will construct a Test case called SeeClientWithDataPool which will use a Data Pool that contains a list of clients. The Test Case will take each of the clients and enter them into a page where they can be viewed.


Step 1: Creating the Test Case

To begin you will need to follow the steps described in the page Starting out with GXtest, the only difference being that when you create the Test Case you should enter the name as SeeClientWithDataPool.

Step 2: Creating the Data Pool

After following these steps you should have a Test Case that always shows the client Abstracta. In order to view more than one client you must create the Clients Data Pool. To do so right click on the Data Pools node in the right-hand panel and select Create New Data Pool as shown in the following figure:

AddDataPool.jpg

Then enter the name (Clients in this case), a description and click Ok.

CreateNewDataPool.jpg

A window appears telling you that the Data Pool was successfully created and you choose the number of columns it will have. For this example you will only have one column called Name.

CreateNewDataPool2.jpg

Click save and it will open so that you can begin to enter data.


Note: The maximum number of columns that a DataPool can have is 99.

Step 3: Entering data into the Data Pool

Here you will enter three pieces of data: Abstracta, Artech and another.

DatosDataPool.jpg

Then click Save to save the data.

Step 4: Associating the Test Case with the Data Pool

Now that you have the Test Case and the Clients Data Pool ready you need to relate the two concepts by telling the Test Case to use the data from the Data Pool. To do this select the Work With Clients node. If you look in the lower part of the screen there is a panel called Work With Clients commands where you can see the command FillInput that has the value “abstracta”. This value will be replaced by the Data Pool Clients. Right click on the FillInput command and select Edit Command as seen in the image.

EditCommandMenu.jpg

A window will then open that allows you to edit the command. In this window are the parameters for the FillInput command. One of these is Value and has “abstracta” entered into it.

EditingCommandValue.jpg

In this parameter you need to select that it is a Data Pool and then choose the Clients Data Pool. This figure show how it should look:

EditingCommandDataPool.jpg

Then click OK to save the changes.

The node is now finished. Remember that the edge line that goes from Work With Clients to Abstracta has a validation that controls for the appearance of the name Abstracta on the screen. Therefore you should follow the same procedure for the AppearText Command that is found on the ClickTable Edge Line that goes from Work With Clients to Abstracta. It is a good idea to change the name of the last page from Abstracta to View Client so that it is more clear. Just right click on the page and change the name.

Lastly and most importantly you need to tell GXtest when to move to the next row of the Data Pool which is done by adding the DPNext command to the beginning of the test case. To do so, right click on the Go Edge Line and then click Add Command. Then select Action from the first combobox and DPNext from the second as seen here:

AddDPNext.jpg

In this window you specify the command parameter that the Data Pool Clients should follow. The model ought to look like the previous window.

The Test Case parameters are now ready and you just need to run it.

Step 5: Running the Test Case

To run the Test Case click the Run N button or Shift+F7.

BotonEjecutarN.jpg

Then tell it to run 3 times

ChooseNWindow.jpg

This will open a new browser and it will be run with Abstracta, then again with Artech and once again with Artech ss.

See also