๐Ÿงผ

SoapUI Basics: Start Your API Testing

Mar 6, 2025

SoapUI Beginner Tutorial: Creating First SoapUI Project

Introduction

  • Objective: Learn how to create a SOAP API testing project.
  • Topics Covered:
    • Adding WSDL
    • Creating test suites and test cases
    • Adding assertions
    • Running test steps, test cases, and test suite
    • Running tests in sequence and parallel
    • Creating API documentation
  • Hands-on Activity: Encouraged to follow along.

Getting Started

  • Open SoapUI.
  • Creating a SOAP Project:
    • Navigate to File > New SOAP Project or click the SOAP icon.
    • Project Setup:
      • Enter project name.
      • Provide initial WSDL (XML document detailing the web service).
      • Select options to create sample requests for all operations.

Working with WSDL

  • Example: Use sample WSDL for a web service that returns a list of continents.
  • Adding WSDL to SoapUI:
    • Copy WSDL URL into SoapUI.
    • SoapUI parses WSDL and creates API requests.

Exploring API Requests

  • Examples of API Calls:
    • Capital city, currency of a country.
  • Data Retrieval:
    • Use operations to retrieve ISO codes and other information.
    • Run requests and analyze responses.

Creating Test Suites and Test Cases

  • Generating a Test Suite:
    • Right-click WSDL and select Generate Test Suite.
    • Options available for test case creation.
    • Name and save test suite.
  • Running Requests:
    • Enter ISO code, run requests, and validate responses.

Adding Assertions

  • Purpose: Validate responses by checking for specific strings or patterns.
  • How to Add:
    • Use "Contains" assertion to search for specific strings in response.
    • Example: Search for "New Delhi" in response.
    • Success indicated by green icons; failure by red icons.

Saving the Project

  • Use Save All to keep project updated.
  • Store project file in desired location.

Running Tests in Sequence and Parallel

  • Hierarchy: Project > Test Suite > Test Case > Test Step.
  • Running Tests:
    • Individual test steps, entire test cases, or whole test suites.
    • Options to run tests in sequence or in parallel.
    • Sequence: Tests run one after the other.
    • Parallel: Tests run simultaneously.

Handling Test Failures

  • Test suite or test case will show failure if any request fails.

Advanced Test Suite Generation

  • Single Test Case: Combine all requests into a single test case.
  • Generate documentation for APIs.

Generating API Documentation

  • How to Create:
    • Right-click WSDL and select Generate Documentation.
    • Saves HTML documentation showing API details.

Updating Definitions

  • Purpose: Refresh project with backend changes.
  • Action: Right-click WSDL and select Update Definition.

Conclusion

  • Summary:
    • Created a simple SOAP API project.
    • Explored various functionalities: adding WSDL, test suites, assertions, etc.
    • Introduction to more advanced features to be covered in future sessions.
  • Upcoming Topics:
    • Ruby scripting, running tests through code.
    • Further exploration of updates and definitions.

Note: This session is foundational for upcoming lessons in SOAP UI.