Enterprise Integration Zone is brought to you in partnership with:

Meera has posted 70 posts at DZone. You can read more from them at their website. View Full User Profile

Functional Web Services Testing Made Easy with SoapUI - Part 3

05.19.2008
| 92016 views |
  • submit to reddit


Let’s consider each of these in more detail.

1. SoapUI and Ant
SoapUI provides command line tools to run various tests. To run the functional tests, we need to use the com.eviware.soapui.tools.SoapUITestCaseRunner class, which takes the path to the SoapUI project file containing the tests and a number of options:

Since the runner runs from the command line, we will use the exec task in Ant. SoapUI comes with scripts based on the operating system you installed it on, testrunner.bat or testrunner.sh. (If you are using a Windows machine and your build machine is using a different operating system, for example UNIX, you will need to make changes to this script.)

Let’s begin by writing out what we need to add to the Ant build file to run these functional tests on a Windows machine. We need to define a target that will run the tests; for clarity, we will also specify properties that will clarify the meanings of the file locations specified:

a. Specify the properties for SoapUI location and the project file

<property name="soapui-location" location="C:\\Program Files\\eviware\\soapUI-1.7.6\\bin"/>
<property name="soapui-project-xml-location" location="Weather-soapui-project.xml"/>

b. Define a target to run the functional tests.

<target name="run-soapui-tests" description="runs all functional SoapUI  tests">
<exec dir="${soapui-location}" executable="cmd.exe" failonerror=”true”>
<arg line="/c testrunner.bat -j -f${reports} -r -a ${soapui-project-xml-location}"/>
</exec>
</target>

At this point, we will open a command window and run the soapui-tests. The output is:

Published at DZone with permission of its author, Meera Subbarao.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

David Sills replied on Mon, 2008/05/19 - 8:46am

What a terrific series, Meera! This is a great introduction to several tools more developers should be using!

SumaBS replied on Mon, 2008/05/19 - 1:34pm

Excellent Series Meera!

Sreekant Rajan replied on Thu, 2008/05/22 - 3:32pm

hi

I would like to know whether SOAPUI support complextype as input values.

2. whether it provides UI based support of testing Webservices

3. whether it generate test result  in the report fasion.

if you have any product which support all these let me know.

 

Sreek

Meera Subbarao replied on Thu, 2008/05/22 - 4:10pm

Hi Sreekant,

Everything you have asked above is what SoapUI is. Also, the AccountManagerBean code shown in this page has all the methods except remove method return a complex type, which in my case is the Account entity object. And the create method does take Account as its input as shown below.

     @WebMethod  
public Account create(Account info)
{
this.manager.persist(info);
return info;
}

 

Srimaan Yerram replied on Sun, 2008/07/20 - 2:12pm

Excellent Material, Much helpful Thank you very much Meera

Ali Raza replied on Fri, 2008/08/01 - 8:49pm

hi,

I am trying to specify my Test Report XML from soapui

as

 

C:\Results\2008-08-01_17-32-28\28\report.xml

 

and I get teh following error in hudson.

 

'C:\Results\2008-08-01_17-32-28\28\report.xml' doesn't match anything: even 'C:' doesn't exist 

What am I doing wrong. why am I getting this error when the report.xml file exists.

Tommy Van Mellaert replied on Thu, 2008/09/04 - 6:37am in response to: Ali Raza

If it is the same cause as in the Test case setup script, then it is the slash.

You used a "backward" slash. It should be a "forward" slash "/" .

Tommy

Ali Raza replied on Thu, 2009/04/23 - 1:22pm

I notice that hudson does not correct display the XML of the soapui request/response. it seems to strip out the ' < ' and ' >' that enclose an element and replace by '& lt;' and '& gt;' respectively. Is there anyway i can property view the XML in hudson. Thanks Ali

yan samantha replied on Tue, 2009/06/16 - 9:23pm

hi,Meera I like this series very much. This is helpful for me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

john green green replied on Fri, 2009/10/23 - 5:53am

hi,Meera I like this series very much. This is helpful for me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

john green green replied on Fri, 2009/10/23 - 5:53am

I notice that hudson does not correct display the XML of the soapui request/response. it seems nike shoes discount to strip out the ' < ' and ' >' that enclose an element and replace by '& lt;' and '& gt;' respectively. Is there anyway i can property view the XML in hudson. Thanks Ali

john green green replied on Sun, 2009/10/25 - 8:48am

Meera I like this series very much. This is helpful nike shoes chinafor me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

Sujit Nayak replied on Sun, 2010/02/28 - 4:05pm

what a explanation, its so clear and neat.

Realy appreciated your effort.

 

-Sujit

marissa (not verified) replied on Mon, 2010/11/15 - 12:12pm

I notice that hudson does not correct display the XML of the soapui request/response. it seems to strip out the ' < ' and ' >' that enclose an losing pregnancy weight element and replace by '& lt;' and '& gt;' respectively. Is there anyway i can property view the XML in hudson.

Sridevi Soundarraju replied on Mon, 2011/10/17 - 11:19am

Hi Meera

I have my Jenkins running on linux and SoapUI running on a different windows machine. How do I invoke the cmd.exe and soapui testsuite in that case? 

Please help...

Thanks

Sri

 

Sridevi Soundarraju replied on Tue, 2011/10/18 - 11:08am

Hi Meera

I have my Jenkins running on linux and SoapUI running on a different windows machine. How do I invoke the cmd.exe and soapui testsuite in that case? Please help... Looking forward for your reply...

Thanks

Sri

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.