JMeter Performance Testing
JMeter Performance Testing
1 INTRODUCTION
Performance Testing of Service Oriented Architecture based applications has multiple challenges, starting from gaining an in depth understanding of the domain to changing the mindset of the testers, as Performance testing of such applications is different from other kinds of testing. While most of the problems can be tackled by one way or the other, there remains a single most important problem that needs a solution Web Services. There is no User Interface for a Web Service. Any changes done in the Web Services might change the object property that the service exposes. So, the Performance Test scripts need to be modified each time a change is made at the Web Service level which defeats the whole purpose of automation. In this paper, I am presenting an easier and cost effective solution to Performance Test Web Services using the Open source Tool Apache JMeter. Before going into the explanation, let us first understand the Web Services and SOA. consuming custom coding. In addition, because all communication is in XML, Web Services are not tied to any one operating system or programming language. Example: Google search is a Web Service which offers search service to the Google.
1.1 Web-Services Web Services are self-contained applications that can run universally across the Internet. They are built using Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP). They serve as building blocks enabling the rapid development and deployment of new applications. They are primarily used as a means for businesses to communicate with each other and with client; Web Services allow organizations to communicate data without having intimate knowledge of each other's IT systems behind the firewall. Unlike traditional client/server models, such as a Web server/Web page system, Web Services do not provide the user with a user interface. Instead, Web Services share business logic, data and processes through a programmatic interface across a network. Developers can then add the Web Service to a user interface (such as a Web page or an executable program) to offer specific functionality to users. Web Services allow different applications from different sources to communicate with each other without time-
1.2 SOA The following are three definitions of SOA from the web. As Wikipedia notes, There is no widely agreed upon definition of SOA other than its literal translation. So any of the follo wing definition that helps you understand what really SOA is has met our goal. A service-oriented architecture is a collection of services that communicate with each other. The services are self-contained and do not depend on the context or state of the other service. They work within distributed systems architecture. A Service Oriented Architecture provides patterns for design, development, deployment and management of a loosely coupled business application infrastructure. In this framework, business functionality is published, discovered, and consumed as part of a business ecosystem of network-aware and reusable technical and business services. Service Oriented Architecture (SOA) is an evolution of distributed computing. SOA provides a modularity of business logic, which can be presented as services for clients (client as in client-server architecture). These services are loosely coupled, in the sense that the 'User Interface' can remain completely independent of the service layer. There is no widely agreed upon definition of SOA other than its literal translation. It is an architecture that relies on serviceorientation as its fundamental design principle. In an SOA environment independent services can be accessed without knowledge of their underlying platform implementation. These concepts can be applied to business, software and other types of producer/consumer systems. SOA allows the enterprises to plug in new services or upgrading the existing services in a granular fashion to address the new business re-
quirements, provides the option to make the services consumable across different channels or exposes the existing enterprise and legacy applications as services, there by safeguarding existing IT infrastructure investments. Example: Integrating the Google search (Web Service) in Google html page is a SOA. The fundamental pieces of the SOA infrastructure are WSDL, UDDI and SOAP. (1) WSDL It is an XML-based language for describing Web Services and how to access them. WSDL stands for Web Services Description Language WSDL is written in XML WSDL is an XML document WSDL is used to describe Web Services WSDL is also used to locate Web Services WSDL is not yet a W3C standard (2) UDDI UDDI is a platform-independent framework for describing services, discovering businesses, and integrating business services by using the Internet. UDDI stands for Universal Description, Discovery and Integration UDDI is a directory for storing information about Web Services UDDI is a directory of Web Service interfaces described by WSDL UDDI communicates via SOAP UDDI is built into the Microsoft .NET platform (3) SOAP It is the default mechanism for Web Services alternative technologies accomplishes other types of bindings for a service. SOAP stands for Simple Object Access Protocol SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP is designed to communicate via Internet SOAP is platform independent SOAP is language independent SOAP is based on XML SOAP is simple and extensible SOAP allows you to get around firewalls SOAP will be developed as a W3C standard
3.1 Using SOAP/XML-RPC Request If we are having the soap request of particular Web Service we can proceed with this sampler. The sampler is as shown below:
Khushali is currently working as Assistant Professor in MCA Department at IITE,Ahmedabad,India E-mail: [email protected]
3.2 Using Web Service (SOAP) request Any changes done in the Web Services code might change the object property that the service exposes. Let us see how to solve this problem. Web Services are defined through Web Service Description Language (WSDL). It is this WSDL that is exposed by the Web Services for invoking the operations they provide. Any change in the structure of Web Services will be a change in WSDL. So if we were able to handle the WSDL files than there is a solution for it. JMeter is capable of handling the WSDL files using the Web Service Request sampler. Steps to be load the WSDL URL: (1) Place the URL in the WSDL URL and click on the Load WSDL button. (2) All the methods available in the WSDL URL will be viewed in the dropdown list of web methods. (3) Select the method to be tested and click on configure button. It loads the protocol, server name, port, path and soap action. (4) If need we can specify the time out for the soap request as shown in the fig. (5) The Soap/XML message for the particular method is to be placed in the space provided as shown below or path of the
file can be specified. Soap Message can be generated using soap-UI or SOA Test Harness (6) To read the soap responses in the view result tree check the Read Soap response check box. (7) Check the Use Proxy and give the corresponding details if the soap request needs proxy even when u invoke the JMeter with proxy. (8) The response of a soap request can be viewed in three forms i.e. in text form, html form and XML form.
Web Service (SOAP) request handles the WSDL URL along with SOAP/XML message where as SOAP/XML-RPC request handles only XML message. It is better to use Web Service (SOAP) request whenever there is raw data of xml request and when you have the formatted xml data you can test the data by SOAP/XML RPC Request. Here the format is related to structure of XML.
4.3.1 XML Assertion The XML Assertion tests that the response data consists of a formally correct XML document. It does not validate the XML based on a DTD or schema or do any further validation. 4.3.2 HTML Assertion The HTML Assertion allows the user to check the HTML, XHTML or XML syntax of the response data using JTidy. So by checking the format option as XML the syntax of response data can be verified. It does not validate the XML based on a DTD or schema or do any further validation. 4.3.3 XPath Assertion XPath addresses the parts of an XML document. XPath assertion validates the response against the nodes or name spaces of an XML. 4.3.4 XML Schema Assertion It validates the response against a XML Schema.
4.1 Parameterization The parameters which are to be passed in the XML data can be passed in the following manner as we send it through the http request.
REFERENCES
[1] [2] [3] [4] [5] http://www.apache.org.in http://msdn.microsoft.com/ http://www.webservices.org http://www.w3.org/TR/ws-arch/ www.uddi.org/pubs/uddi_v3.htm http://www.w3.org/TR/soap/
[6]
4.2 Correlation Correlation for soap request can be done in the same manner as http requests. The Post Processors which can be used for the correlation are: Regular Expression Extractor. XPath Extractor. 4.3 Verify the Response The response data can be verified by using Assertions. Different Assertions that are available in JMeter are:
IJSER 2012 http://www.ijser.org