Difference between revisions of "SoapUI integration"

From GXtest Wiki
Jump to: navigation, search
(Creating the SoapUI project)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Idiomas
 +
| Integración con SoapUI
 +
| SoapUI integration
 +
| SoapUI との統合
 +
}}
 +
 +
SoapUI can be used along with GXtest to invoke complex WebServices during the execution of a GXtest test case. This article explains how to integrate a SoapUI call into GXtest.
 +
 +
 
== Creating the SoapUI project ==
 
== Creating the SoapUI project ==
  
  
[http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=introduccion-soapUI # This] link is an introduction to soapUI and a guide to create a project.
+
[http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=introduccion-soapUI This] link is both an introduction to soapUI as well as a guide for creating a project.
After we created the project, we will create the TestSuit, for this we right click on the service we will test and choose the option Generate TestSuit
+
After creating the project we will also be creating a Test Suite. Let's get started, the first thing we should do is right clicking on the service we will be testing, after which, we will choose the option Generate Test Suite:
 
  [[Image:SoapUI1.png |center ]]
 
  [[Image:SoapUI1.png |center ]]
  
This displays the following window
+
The following window should be displayed on screen:
  
 
[[Image:SoapUI2.png |center ]]
 
[[Image:SoapUI2.png |center ]]
  
In which we choose the operations for which we are going to define test cases, if we can make a case for operation or a case with all operations contained and if we want to generate load tests. This we will leave as the default.
+
From that window we will be choosing the operations for which we are defining the test cases, whether it is either a single test case per operation, or a test case containing all the operations in it, or, if we are keen on generating load tests. For this particular example, we will be using the default configuration.
After we have the TestSuit click the icon that is above the project tree, this will make the properties visible in the tree.
+
 
 +
After we have the Test Suite created, click on the icon which is above the project tree, that will make the properties visible in the tree.
  
 
[[Image:SoapUI3.png |center ]]
 
[[Image:SoapUI3.png |center ]]
  
We right click to properties that are defined in the next level of project name and choose Add Property. This defines a property project level.
+
From the properties option, available a level underneath the project's name, we will choose the option Add Property, it will let us define a Project Level Property.
Now we have to put a name, in this case we will use Country, this creates a new element in the tree. If we double click we will be able to define it a value, leave it empty for now.  
+
Next, we need to add a name, for this example we will employ Country, and doing so creates a new element in the tree. For so long as we double click on it we will be able to provide it with a value, however, and for the sake of this example it will remain blank for now.
The Properties we define here, we are going to use as parameters to calls to web services.
+
 
Now we have to modify the parameter with which web services are called by the name defined in the properties parameter.
+
Bear in mind that the Properties we defined here, are going to be used as parameters to call web services. Having that said, now we have to modify the parameter with web services which are being called by the name defined in the properties parameter.
To do this, open the case where we want to parameterize, we give right click on the position where you have to set the parameter and choose Get Data, Project and name of the property that we define.
+
In order to do so, open the test case we want to parameterize, then right click on the position where you have to set the parameter and choose Get Data --> Project and name of the property that we define.
 +
 
 
[[Image:SoapUI4.png |center | 683px ]]
 
[[Image:SoapUI4.png |center | 683px ]]
  
Line 26: Line 37:
 
[[Image:SoapUI5.png |center ]]
 
[[Image:SoapUI5.png |center ]]
  
After changing all the web services to take the parameters, we will get the command to use from gxtest, for this we right click on the project and choose the option Launch TestRunner
+
After changing all the web services to accept the parameters, we will have available the command to use from GXtest, right click on the project and as portrayed in the following screenshot, choose the option Launch TestRunner
  
 
[[Image:SoapUI6.png |center ]]
 
[[Image:SoapUI6.png |center ]]
  
This shows a window in which we will have to modify Basic, Report and Properties tabs.
+
That action will display a window in which we will modify the three following tabs Basic, Report and Properties.
  
 
[[Image:SoapUI7.png |center ]]
 
[[Image:SoapUI7.png |center ]]
  
In Basic we need to specify the path where the TestRunner, which is in the path where the program is installed in the bin folder, and can also indicate if we are to test all TestSuit or any particular case.
+
In Basic we need to specify the path where the TestRunner, which is the path where the program is installed in the bin folder, and can also indicate if we are to test all Test Suites or a test case in particular.
  
 
[[Image:SoapUI8.png |center ]]
 
[[Image:SoapUI8.png |center ]]
  
In the Properties tab define the values for the parameters defined above, with parameter = value syntax.
+
In the Properties tab we will define the values for the parameters defined with the following syntax parameter = value.
  
 
[[Image:SoapUI9.png |center ]]
 
[[Image:SoapUI9.png |center ]]
  
In the Report tab can indicate where to save the logs of the test. If you check Export All we always generate the report, but only in case of error.
+
In the Report tab we can indicate where we would like saving the logs of the test case. Provided the Export All option is checked, we will always generate the report, yet only in case of an error.
Then we click Launch and that is going to run the selected tests, from here we will get the arguments that we use with gxtest.
+
Lastly, clicking Launch is going to run the selected test cases, from that point is where we will get the arguments that we will use with GXtest.
  
 
[[Image:SoapUI10.png |center | 638px ]]
 
[[Image:SoapUI10.png |center | 638px ]]
  
-s  The suite where the test case.
+
-s  The suite where the test case is located.
  
-c  The test case.
+
-c  The test case itself.
  
-a  To save logs always.
+
-a  To always save logs.
  
 
-f  It is the path where the logs are to be saved
 
-f  It is the path where the logs are to be saved
  
-P  It is the value you select for the Country parameter, in case you want to pass a parameter to a datapool of Spain GXTest the value will change.
+
-P  It is the value you select for the Country parameter, in case you want to pass a parameter to a datapool of Spain GXtest the value will change.
  
 
C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml
 
C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml
Line 61: Line 72:
 
It is the path where the project is located
 
It is the path where the project is located
  
== Running in GXTest ==
+
== Running in GXtest ==
  
To run soapUI tests with data obtained from Datapools of GXTest we will use the testrunner.bat included in soapUI, for that first we have to do is get the parameters as we saw before, for example  
+
To run soapUI tests with data obtained from Datapools of GXtest we will use the testrunner.bat included in soapUI, for that first we have to do is get the parameters as we saw before, for example  
 
-a -fC:\Users\Sebastian\Desktop -GPais=Spain C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml  
 
-a -fC:\Users\Sebastian\Desktop -GPais=Spain C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml  
 
After this we create an Action Concatenation in which we will add these parameters
 
After this we create an Action Concatenation in which we will add these parameters
Line 75: Line 86:
  
 
Here we put the path where the testrunner.bat and the argument that we define is Concatenation.
 
Here we put the path where the testrunner.bat and the argument that we define is Concatenation.
 
  
 
== Resources ==
 
== Resources ==
Line 85: Line 95:
 
2. Download SoapUI project from [[Media:Tiempo-meteorologico-soapui-project.rar |this]] link
 
2. Download SoapUI project from [[Media:Tiempo-meteorologico-soapui-project.rar |this]] link
  
3. Download GXTest project from [[Media:WebServices.zip |this]] link
+
3. Download GXtest project from [[Media:WebServices.zip |this]] link

Latest revision as of 16:15, 2 September 2015

Spanish.gif
English.gif
Japan.gif

SoapUI can be used along with GXtest to invoke complex WebServices during the execution of a GXtest test case. This article explains how to integrate a SoapUI call into GXtest.


Creating the SoapUI project

This link is both an introduction to soapUI as well as a guide for creating a project. After creating the project we will also be creating a Test Suite. Let's get started, the first thing we should do is right clicking on the service we will be testing, after which, we will choose the option Generate Test Suite:

SoapUI1.png

The following window should be displayed on screen:

SoapUI2.png

From that window we will be choosing the operations for which we are defining the test cases, whether it is either a single test case per operation, or a test case containing all the operations in it, or, if we are keen on generating load tests. For this particular example, we will be using the default configuration.

After we have the Test Suite created, click on the icon which is above the project tree, that will make the properties visible in the tree.

SoapUI3.png

From the properties option, available a level underneath the project's name, we will choose the option Add Property, it will let us define a Project Level Property. Next, we need to add a name, for this example we will employ Country, and doing so creates a new element in the tree. For so long as we double click on it we will be able to provide it with a value, however, and for the sake of this example it will remain blank for now.

Bear in mind that the Properties we defined here, are going to be used as parameters to call web services. Having that said, now we have to modify the parameter with web services which are being called by the name defined in the properties parameter. In order to do so, open the test case we want to parameterize, then right click on the position where you have to set the parameter and choose Get Data --> Project and name of the property that we define.

SoapUI4.png

The request will be:

SoapUI5.png

After changing all the web services to accept the parameters, we will have available the command to use from GXtest, right click on the project and as portrayed in the following screenshot, choose the option Launch TestRunner

SoapUI6.png

That action will display a window in which we will modify the three following tabs Basic, Report and Properties.

SoapUI7.png

In Basic we need to specify the path where the TestRunner, which is the path where the program is installed in the bin folder, and can also indicate if we are to test all Test Suites or a test case in particular.

SoapUI8.png

In the Properties tab we will define the values for the parameters defined with the following syntax parameter = value.

SoapUI9.png

In the Report tab we can indicate where we would like saving the logs of the test case. Provided the Export All option is checked, we will always generate the report, yet only in case of an error. Lastly, clicking Launch is going to run the selected test cases, from that point is where we will get the arguments that we will use with GXtest.

SoapUI10.png

-s The suite where the test case is located.

-c The test case itself.

-a To always save logs.

-f It is the path where the logs are to be saved

-P It is the value you select for the Country parameter, in case you want to pass a parameter to a datapool of Spain GXtest the value will change.

C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml

It is the path where the project is located

Running in GXtest

To run soapUI tests with data obtained from Datapools of GXtest we will use the testrunner.bat included in soapUI, for that first we have to do is get the parameters as we saw before, for example -a -fC:\Users\Sebastian\Desktop -GPais=Spain C:\Users\Sebastian\Documents\Tiempo-meteorologico-soapui-project.xml After this we create an Action Concatenation in which we will add these parameters

SoapUI11.png

Here we add the parameters that will be used and changed by the value of the datapool. After that you have to make the call to the TestRunner so that we create an Action Execute

SoapUI12.png

Here we put the path where the testrunner.bat and the argument that we define is Concatenation.

Resources

Here are the files to follow the example described.

1. Download the KB sample from this link

2. Download SoapUI project from this link

3. Download GXtest project from this link