> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/asp-net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/asp-net/chapter4rest-apiweb-services-testing-with-soapui/42soapui-basics/421create-testsuite-and-testcase.md).

# 4.2.1.Create TestSuite and TestCase

* 1.Create SOAP project
  * 一定要先有WSDL來源, e.g., <http://www.dneonline.com/calculator.asmx?WSDL>
* 2.Create test suite
  * Right click folder -> New TestSuite

    ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6hJv4M0oNcBgh7%2F201804114.jpg?generation=1586302967931808\&alt=media)
* 3.Create test case
  * Right click request -> Add to TestCase

    ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6jwe257zlR-Uqk%2F201804115.jpg?generation=1586302968176495\&alt=media)
* 4.Create test steps for test case
  * Drag the request to the test steps

    ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6llZMoEd0G84ly%2F201804116.jpg?generation=1586302968644808\&alt=media)
* 5.Testing
  * 1.Assertion
    * SOAP Response: 檢查SOAP格式是否正確 ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6n4pkunBK6mLJE%2F201804117.jpg?generation=1586302967838727\&alt=media)
    * SOAP格式
      * 必須要有Header, Body以及內容
      * e.g.,

        ```
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:blz="http://thomas-bayer.com/blz/">
        <soapenv:Header/>
         <soapenv:Body>
            <blz:getBank>
               <blz:blz>55010111</blz:blz>
            </blz:getBank>
         </soapenv:Body>
        </soapenv:Envelope>
        ```
  * 2.在Test case level執行測試
    * 可以拖曳多個request到test steps後, 點選綠色按鈕一次執行
    * 下方的TestCase log視窗, 打開後可以看到詳細的Request, Response資訊&#x20;

      ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6pxFDSoxhawcU9%2F201804118.jpg?generation=1586302967716535\&alt=media)
  * 3.在Test suite level執行測試
    * 可以建立多個test case, 點選綠色按鈕一次執行

      ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Y6rM0XHKftDPd4x%2F201804119.jpg?generation=1586302968258509\&alt=media)
