Better Software - March 2009 - (Page 34) First, create data tables like those shown in tables 1 and 2, as you would when testing any application. There are many ways to set up these data tables, but we have found that it works best to These criteria are combined into a have columns corresponding directly to Sell Your Junk SOAP request that looks the XML request and response values. like listing 1. Using the Sell Your Junk example, there are four values being sent in itemDescription, and ac countNumber) and one value (statusCode), being sent back from the Web service in the XML response. This data table GadgetPhoto.zip structure allows us to have the 1000 input data and expected values Really cool gadget! on the same line, making for ABC123DEF easy execution and setup for automation in the future. cid:123604199920 tables, include valid and in valid data that test all fields as you would when testing any Web application, keeping in mind boundary values, special Listing 1 conditions, and project-specific requirements such as file The Web service then returns an XML service as we would any Web applicatypes and sizes. response to the original XML request. tion, verifying that all scenarios have Now that we have data, we need a Here the Web service returns a status been exercised and all transactions have code of 0 for success and 1 for failure. been followed end to end. To perform Web service test tool to input the data. The Sell Your Junk SOAP response functionality testing, create test cases The developers could create a GUI front looks like listing 2. and data for all valid and invalid test end so you can enter data and check By verifying the XML response you scenarios. Then, using a Web service test the responses, or you can use one of a are able to determine that the applica- tool, send XML requests to the Web ser- number of Web service test tools. Most Web service test tools do the tion is functioning properly. vice and receive and verify that the XML response is correct. Once you have the following: 1) Read the Web services description language (WSDL) 2) Give the user a GUI to submit data 3) Create an XML file from the selections that the user 0 has made 4) Send the XML request to the Web Service 5) Receive the XML response from the Web Service 6) Display the results Listing 2 34 BETTER SOFTWARE MARCH 2009 • The file name must be a zip file that is less than 255 alphanumeric characters long. • The item price must be a number from 1 to 9999. • The item description must be between one and 255 alphanumeric characters. • The account number must be the submitter’s account number and nine alphanumeric characters. Functionality Testing The theory behind testing Web services is not complex—send an XMLbased request to a Web service, receive an XML-based response, and evaluate that response for correctness. Web testers encounter challenges when testing the functionality of Web services because they are different from what Web testers are used to. Web services are headless—they do not have a Web user interface. They also are stateless—they do not remember information about past transactions. To mitigate these challenges, we need to test the Web response, you can view the results in the test tool or use a file comparison tool to compare the response values to expected results. how cAn we test the sell your Junk web service? www.StickyMinds.com http://www.StickyMinds.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.