Getting Started with API Testing


Welcome to ZAPTEST tutorials! In this tutorial we will show you how to use ZAPTEST API testing features to create and execute a web service test procedure If you need any information about best practices or a description of methods, please go to our websites how-to page. For API related videos please navigate to the API methods section; or you can use ZAPTEST PDF documentation for reference of any of the API methods. During this lesson you will learn about ZAPTEST API explorer You will create a test to make a simple web service request And you will learn how to parse a server’s response In the tutorial exercises we will be using a demo of web services provided by ZAPTEST for educational purposes. The servers address is displayed here We will start by defining a new API server Object; to do this we will navigate to the API explorer GUI component and press the add new server button. On this dialog we will define a logical name for the server; type the demo servers URL; select the check box to load the WSDL file and click okay. ZAPTEST uses information from the WSDL file to include all available web service methods. In our test we will use the Get Products Method, this method returns a list of products made by ZAPTEST. We don’t need to provide any request arguments for this method. To define a test step, we can simply drag the method into the step workflow area and select execute operation from the list. We will use a local variable to store the server’s response. In this step we will type a name for the variable response; drag Get Products for a ZAP Object and select the Get String response method. We need to send the response value to the test results; to do this we will drag the API server object and select custom report method. For its arguments we will select true for the status; enter a name for this step and use a response variable for the step detail value. Next, we will save our test and run it. Once the test run has finished, we will open our results. In the xml response value, we can identify an array of two product items, ZAPTEST and ZAPFARM; and the name of the node Get Product Results. Next, we will define steps to retrieve and report the product values. We will add a local variable step, give it a name Product 1; drag Get Products for a ZAP Object; select get Member response Method and type the name of the node – Get Products Result with the array item index = 0. Now we will copy this step to create a new variable – Product 2 and we will use it to store the second item from the Get Products Result array. Next, we will add two custom reporting steps to send the product values to the test results. We will run this test again and review the results. Product 1 and Product 2 steps should display correct product values. In this tutorial lesson, you have learned how to Use the API explorer and define API objects How to make steps for a web service request And how to parse a server’s response and retrieve XML data elements Thank you for using ZAPTEST!

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227