Difference between revisions of "SoapUI integration"

From GXtest Wiki
Jump to: navigation, search
(Creating the SoapUI project)
(Creating the SoapUI project)
Line 10: Line 10:
 
[[Image:SoapUI2.png |center ]]
 
[[Image:SoapUI2.png |center ]]
  
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, or if we are keen on generating 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 28:
 
[[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 ]]

Revision as of 15:25, 20 December 2013

Creating the SoapUI project

This link is both an introduction to soapUI ggas 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 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. 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.

SoapUI10.png

-s The suite where the test case.

-c The test case.

-a To save logs always.

-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