DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Using Fitnesse for web service testing

Ramsundar Kuppusamy user avatar by
Ramsundar Kuppusamy
·
May. 17, 10 · Interview
Like (1)
Save
Tweet
Share
17.75K Views

Join the DZone community and get the full member experience.

Join For Free

Fitnesse is a proven and widely accepted acceptance testing framework. Due to the growing adoption of web services, the need for testing web services has become very important. There are lot of good tools out there to perform functional testing on webservices like SoapUI,SOAPSonar,etc. I have personally used SoapUI and its great for basic needs. A good functional testing tool should really help you in automating your tests.

Most of the tools out there have cool features to create test suites/test cases and write assertions. But over a period of time, when you have lot of web services, following are some of the common problems you might encounter with tools like SoapUI:

Refactoring: If the wsdl definition changes for some reason, how easy it is easy to refactor all the test cases/suites?

Simplicity: sometimes, xpath is not  sufficient to write a test case. SoapUI does support groovy scripts. But groovy is not something that can be used by all of your QA team members.

Sharing: When your entire QA team is actively involved in writing automated functional tests (eg: using SoapUI) how to share the same script between different team members becomes a concern. Its not so easy to merge xml files modified by different people for non-developers.

Readability: The readability of the test cases created is highly influenced by the element names in the wsdl file i.e you cannot take control of the naming convention of request parameters in your web service requests.

Most of the above said shortcomings can be overcome by using fitnesse for automating your webservice testing. Before, talking about the advantages lets take a simple example where i want to use yahoo web service to perform some search operation.

 


The above example uses yahoo api to make a search.The first table "Make Request to Yahoo" takes your search request and result size as parameter. The "Verify Response" table validates the actual response from yahoo search with your expected results. As you can see above,the tabular format of Fitnesse table is highly readable and easy to understand.

Going back to our above listed shortcomings in using tools like SoapUI, fitnesse addresses most of them like,

Refactoring: Since the fixtures are written in java, refactoring is easy.

Simplicity: QA team is not exposed to underlying comlpexity(fixture code). A simple tabular format looks more simple to them without worrying about any scripting language.

Sharing: This is one of the most appealing reason.Hosting as a wiki makes sharing so simple.

Readability: The column names in the Fitnesse table need not be same as the wsdl element names.You can have layer of absraction in the fixture code to take up this burden.

In this simple example no webservice frameworks have been used. The clients are created using HttpClient library and unmarshalling is done using JAXB.

For the complete source code of the above example, click here.

Web Service FitNesse

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Leverage Lambdas for Cleaner Code
  • Isolating Noisy Neighbors in Distributed Systems: The Power of Shuffle-Sharding
  • Creating a Personal ReadMe for Scrum Masters With ChatGPT
  • Low-Code and No-Code Are the Future of Work — For IT and Beyond

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: