{"id":47208,"date":"2017-03-29T15:45:07","date_gmt":"2017-03-29T10:15:07","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=47208"},"modified":"2017-03-30T09:37:04","modified_gmt":"2017-03-30T04:07:04","slug":"api-testing-using-soapui","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/api-testing-using-soapui\/","title":{"rendered":"API Testing Using SoapUI"},"content":{"rendered":"<p><a href=\"http:\/\/www.tothenew.com\/testing\/automated-independent-manual-testing\">API testing<\/a> is crucial to companies. In this blog, we will share the\u00a0basic procedure of working with SoapUI.<\/p>\n<p>Let us start by <a href=\"http:\/\/www.tothenew.com\/blog\/5-things-to-know-before-you-start-api-testing\/\">understanding the basic requirements<\/a> and how to set up a SoapUI in the machine. Once done, we will navigate towards a sample project structure.<\/p>\n<p><strong>Basic Requirements<\/strong><br \/>\nBefore starting with the SoupUI tool, consider developing a product API document which should contain all the information about the <strong>API (REST or SOAP)<\/strong> used in production. This should contain a detailed description of each <strong>API<\/strong>, <strong>HTTP<\/strong> <strong>Methods (POST, GET, PUT, and DELETE),<\/strong> detailed information about <strong>Request<\/strong> and <strong>Response<\/strong>. Relationship OR interrelated API should properly communicate through this document.<\/p>\n<p>Here&#8217;s an example<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47209 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image1-300x285.png\" alt=\"ExampleAPI\" width=\"300\" height=\"285\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image1-300x285.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image1.png 514w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><strong><br \/>\nWorking with SoapUI<br \/>\n<\/strong><\/p>\n<p>Outlined below are the steps or sequences which are to be followed to use a Soap API efficiently.<\/p>\n<p>&#8211; Set up SoapUI<br \/>\n&#8211; Requirement Document<br \/>\n&#8211; Get started with project Structure<br \/>\n&#8211; Add a workspace and Project<br \/>\n&#8211; Add a test suite and test case<br \/>\n&#8211; Add a test step<br \/>\n&#8211; Run a test suite<br \/>\n&#8211; Add Property Transfer (If needed)<br \/>\n&#8211; Add an assertion<\/p>\n<p><strong>How to get started with the project structure?<\/strong><\/p>\n<p>Let us first understand the <a href=\"http:\/\/www.tothenew.com\/blog\/testing-webservice-using-soapui\/\">project structure in SOAP UI<\/a>:-<\/p>\n<ul>\n<li>As a first step, create a workspace. There can be several projects associated with a workspace. Users can create more than one workspace. In SOAP UI Pro version, we can seamlessly switch environments to map it to different end points<\/li>\n<li>For each project, we can create several test suites<\/li>\n<li>For each test suite, there can be several test cases attached to it<\/li>\n<li>For each test case, there can be several test steps associated with it<\/li>\n<\/ul>\n<p>Below is the pictorial representation of a workspace structure in SOAP-UI:-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47210 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image2-300x197.png\" alt=\"Workspace\" width=\"300\" height=\"197\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image2-300x197.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image2.png 624w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><strong>Now let us walk you through steps for adding workspace and project<\/strong><\/p>\n<p>Step 1 \u2013 Start SOAPUI<br \/>\nStep 2 \u2013 Create a Workspace<\/p>\n<p><strong>File | Right Click | New Workspace\u00a0\u00a0\u00a0 or<br \/>\n<\/strong><strong>Project Navigational Area |Right Click | New Workspace<\/strong><strong><br \/>\n<\/strong><\/p>\n<p>Step 3 \u2013 Enter the name of the workspace<br \/>\nStep 4 \u2013 Select the path where you want to save your workspace<br \/>\nStep 5 \u2013 Click on Save.<br \/>\nStep 6 \u2013 Create Project<\/p>\n<p><strong>File | Right Click | New REST\/SOAP Project or\u00a0\u00a0<\/strong><strong><br \/>\n<\/strong><strong>Quick Access Toolbar |Select REST\/SOAP\/EMPTY <\/strong>(according to the API)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47211 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image3-300x87.png\" alt=\"StepA\" width=\"300\" height=\"87\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image3-300x87.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image3-624x182.png 624w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image3.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47212 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image4-157x300.png\" alt=\"Step2\" width=\"157\" height=\"300\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image4-157x300.png 157w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image4.png 282w\" sizes=\"(max-width: 157px) 100vw, 157px\" \/><\/p>\n<p>Step 7 \u2013 Enter the URI available in the API doc. (Taking an example of REST API).For e.g. \u2013 In API 1, URI is Http:\/\/ cloudapp.net:3000\/v1\/pin<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47213 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image5-300x133.png\" alt=\"Step3\" width=\"300\" height=\"133\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image5-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image5.png 480w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>A new project should have shown up in the Navigator section in the left section of SoapUI. \u201cRequest 1\u201d is a name that SoapUI has generated for us. We want to change it to a name that is more descriptive. In this example, we have chosen \u201cRequest Pin.\u201d Right click on \u201cRequest 1\u201d and set the new name.<\/p>\n<p>Step 8 \u2013 Change the method, according to the API doc, if required. For E.g. in this case, this is a <a href=\"http:\/\/www.tothenew.com\/blog\/server-to-server-post-request\/\">Post method<\/a>.<br \/>\nStep 9 \u2013 From the media type, select application\/JSON (according to this API)<br \/>\nStep 10 \u2013 Enter the JSON request (parameters with its value) in the block as shown below<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47214 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image6-300x192.png\" alt=\"Step4\" width=\"300\" height=\"192\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image6-300x192.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image6.png 504w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><strong>Note<\/strong>: If you want to validate whether the request is valid, you can provide a small, green arrow at the top left corner of the request editor and check the response.<\/p>\n<p>Step 11 \u2013 Create Test Suite<\/p>\n<p><strong>Select Project | Right Click | New TestSuite\u00a0\u00a0\u00a0 or \u201cCtrl+T\u201d or<br \/>\n<\/strong><strong>Click on the third icon from the left of the request editor <\/strong>(as shown below)<\/p>\n<p><strong>\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47215 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image7-300x18.png\" alt=\"Step11\" width=\"300\" height=\"18\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image7-300x18.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image7-1024x63.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image7-624x38.png 624w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image7.png 1278w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/strong><\/p>\n<p>Step 12 \u2013 Create Test Case<\/p>\n<p><strong>Select TestSuite | Right Click | New TestCase\u00a0\u00a0\u00a0 or \u201cCtrl+N\u201d or<br \/>\n<\/strong><strong>Click on the\u00a0third icon from the left of the request editor <\/strong>(as shown above) |<strong>Enter the TestSuite\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name | Enter the TestCase name | Click on OK<\/strong><strong><br \/>\n<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47217 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image9-300x104.png\" alt=\"Image9\" width=\"300\" height=\"104\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image9-300x104.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image9.png 355w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47216 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image8-300x243.png\" alt=\"Step12\" width=\"300\" height=\"243\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image8-300x243.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image8.png 332w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Step 13 \u2013 Create Test Step<\/p>\n<ul>\n<li><strong>Select TestCase | Right Click | Add Step |Rest Request <\/strong>(according to the API)<\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47218 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image10-300x72.png\" alt=\"Step13\" width=\"300\" height=\"72\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image10-300x72.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image10.png 534w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<ul>\n<li>Enter the step name<\/li>\n<li>Upon clicking &#8216;OK&#8217;, a dialog pops up to select the operation to invoke. All the operations are listed, and the user can select the operation that they would like to invoke.<\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47219 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image11-300x72.png\" alt=\"Step13B\" width=\"300\" height=\"72\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image11-300x72.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image11-624x149.png 624w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image11.png 783w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Step 14 -Run a TestStep\/TestCase\/TestSuite. Click on the small, green arrow at the top left corner of the request editor.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47220 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image12-300x89.png\" alt=\"Step14\" width=\"300\" height=\"89\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image12-300x89.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image12-624x186.png 624w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image12.png 1005w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>If you want to run all of your TestCases or TestSuite in one go then select the TestCase or TestSuite respectively and click on their respective green arrow icon as shown in the image below.<\/p>\n<p><strong><strong>Run Testcase<\/strong><\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47221 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image13-300x273.png\" alt=\"Step14A\" width=\"300\" height=\"273\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image13-300x273.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image13.png 357w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><strong>Run TestSuite\u00a0<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-47222 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image14-300x232.png\" alt=\"Step14B\" width=\"300\" height=\"232\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image14-300x232.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/Image14.png 326w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Hope this blog was helpful and you will now be able to test your APIs using SOAPUI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>API testing is crucial to companies. In this blog, we will share the\u00a0basic procedure of working with SoapUI. Let us start by understanding the basic requirements and how to set up a SoapUI in the machine. Once done, we will navigate towards a sample project structure. Basic Requirements Before starting with the SoupUI tool, consider [&hellip;]<\/p>\n","protected":false},"author":859,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":19},"categories":[1818,1,1816],"tags":[4468,1561,14,4517],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/47208"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/859"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=47208"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/47208\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=47208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=47208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=47208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}