White paper ready api

7

Click here to load reader

Transcript of White paper ready api

Page 1: White paper  ready api

Nithin Bijjala

White Paper- Web Services Automation Testing using SoapUI NG Pro Tool

Abstract

Testing team always faces difficulties while dealing with Web services Web services usually do not have visible, user-friendly interfaces, so performing

manual testing is always not easy. Web services hide all of the details of their underlying business logic and appear

as code in response and request to the Testers. It can be hard for testers to knowif they are getting what they should from a Web service.

It’s always challenging for testers to find all of the right inputs to exhaustivelytest Web services, but it’s crucial to check if business logic is correctlyimplemented.

Most popularly used tool for testing Web services is SoapUI which allows you totest web services manually as well as using automation suite.

In short, businesses need a comprehensive methodology inclusive of tools andautomation framework for designing and executing thorough Web services testing. Thiswhite paper outlines a data driven automation framework which can be developed inSoapUI which helps testing teams and business owners design, setup and executecomprehensive tests for testing services quickly and run them in lights-out modewithout having exceptional automation skills.

22/06/2016Artha Data Solutions | www.thinkartha.com

1

Page 2: White paper  ready api

Nithin Bijjala

Introduction

Service Oriented Architecture (SOA) is the emerging paradigm for the development ofdistributed applications that are easy to integrate and flexible to fast changes of theenvironment and of user requirements. IT technology trend is that the business andsocial welfare are more and more depending on the proper functioning of servicesdelivered over the Net. Companies need to have an eye on a provided service, againstaccidental or intentional faults. Because of their pervasive distribution, company mustoffer very strict guarantees in this regard, even for services that are not dealing withsafety-critical or money-critical applications.

For this reason, it is imperative that companies are thoroughly tested beforedeployment. Essentially, a company collects a set of functions, whose invocation syntaxis defined in the associated WSDL document. The WSDL formalizeddescription of service operations and of their input and output parameters can be in facttaken as a reference for black box testing at the service interface.

Soap UI tool can automatically derive skeletons of test cases and provide support fortheir execution and result analysis which ultimately results in saving human efforts, timeand money.

I. WEB SERVICES AUTOMATION FRAMEWORK

The Automated Framework for testing Web services evolved to handle the manybusiness scenarios and use cases required for testing large volumes of data passingthrough Web services. The Automation Framework interacts with external data sourcesto import data, pass it to XML-formatted requests, and process the requests. Theframework automatically generates reports of test runs and shows the results in an easyto-read text format.

Test teams appreciate these key advantages that the Automation Frameworkenables

Quick and easy development of reusable, automated test scripts Automatic execution of regression tests on different data sets Significant suppression in maintenance costs can be used by new team members

using consistent and easy design, development, and execution techniques

22/06/2016Artha Data Solutions | www.thinkartha.com

2

Page 3: White paper  ready api

Nithin Bijjala

II. EASE OF WORKING

Web services basically works with Client-Server architecture through WSDL.

Graphical representation for the same:

In Client-Server architecture User executes a request with the correct Server; Serverperforms the requested task and sends response back to the User.

In order to use the web server’s applications we have WSDL. WSDL (Web ServicesDescription Language) is an XML-based interface description language that is used fordescribing the functionality offered by a web service.

III. SOAPUI OVERVIEW

We use SoapUI application to execute requests and get responses. SoapUI is a verypowerful application. SoapUI allows us to easily and rapidly create and executeautomated functional, regression, compliance, and load tests.

Some of the important options we use in SoapUI:

a. Import: We can import a project in SoapUI.b. Run: We can execute a request by clicking on Run button.c. Stop: We can stop the execution of the request by clicking on stop button.

22/06/2016Artha Data Solutions | www.thinkartha.com

3

Page 4: White paper  ready api

Nithin Bijjala

SoapUI with a request and response is shown below:

IV.COMPONENT TESTING MULTIPLE WEB SERVICES IN A SINGLE EXECUTION

In flow terms, a business scenario involves the integration of dependent API methodsdeveloped for a specific business requirement. We can configure data in a MicrosoftExcel file for testing all of the valid and invalid Transaction flows that occur during abusiness scenario. During execution, a script can populate the scenario’s Results columnwith the test execution status. The possible values the script returns are Pass, Fail, orNot Executed. Within a defined scenario, if any request to a specific API method fails,the script returns fail for the entire scenario.

Configure the frame work The SoapUI Automation Framework provides test engineerswith an easy-to configure, reusable SoapUI project file called the “Base Project.”

The Base Project includes Groovy code that reads the Excel file from Test Suite anddynamically creates test cases, using the SoapUI tool. These test cases validate thefunctionality of the Web service or services by sending the XML-formatted requests asspecified in the test case and verifying the response accordingly.

22/06/2016Artha Data Solutions | www.thinkartha.com

4

Page 5: White paper  ready api

Nithin Bijjala

When configuring the Base Project, Testers need to set up another primary componentof the framework - Properties. Properties allow users to configure and use specific valuein different test steps within Test Suite. To specify the configuration values used withinthe Groovy test scripts, users can create properties in Test Suite and at the test-caselevel with a Base Project. The values can be referenced using either property transfer orproperty expansion mechanisms. The Automation Framework has pre-definedproperties that help the Groovy scripts to set configurations with the values engineerscreated in Test Suite. In other words, properties defined at the test-case level fromruntime, such as result file name or report file name, are automatically generated andassigned by the Groovy script.

V. Using SoapUI pro for load testing

Load Testing is quite unique in SoapUI, we have created a functionality that allows youto create Performance Tests quickly and modify them easily. This allows you to veryquickly create advanced Performance Tests. You can then validate a Web Serviceperformance under different Load scenarios, maintain functional validations to see thatthey don't break under load, run several load tests simultaneously to see how theyaffect each other and much more.

Some of the important options we use in SoapUI for Load Testing:

Create a new Load TestRun the Load TestAdd Assertions to the Load Test

Load Testing Screen print as shown below:

22/06/2016Artha Data Solutions | www.thinkartha.com

5

Page 6: White paper  ready api

Nithin Bijjala

Load Test Graphical representation:

Load Test Metrice:

Benefits:

Provides a fast solution for easy development and automated execution Reduces human efforts Easy to understand to new test team members Provides an extensible scope for automating Web services testing.

22/06/2016Artha Data Solutions | www.thinkartha.com

6

Page 7: White paper  ready api

Nithin Bijjala

Conclusion

Testing of Web Services is very challenging activity. Many characteristics (runtimediscovery, multi-organization integration) of this new paradigm and its relatedtechnologies certainly make testing much more difficult.

There are other characteristics that could be fruitfully exploited Towards AutomatedWSDL-Based Testing of Web Services for testing purposes. Among these, therepresentation of data in a computer readable format (typically XML-based) facilitatesthe automatic derivation of data instances to be used for testing invocations. Startingfrom this consideration we presented a methodology to automatically derive testmessages from WSDL descriptions. Such messages include data representing possiblevalues that a real implementation of the service should be able to handle. Furthermore,by use of our tool SoapUI, we proposed to exploit the characteristics of an XML to inputdifferent data and in output results from response to automatically check and store.This would result in the derivation of a test suite of messages that are representative ofthe space of possible messages.

22/06/2016Artha Data Solutions | www.thinkartha.com

7