# Creating WebService Test Case

## Creating New WebService Test Step Group

To add a Test Step Group in a Test case, perform the following actions:&#x20;

1. On the **Home** page, select the required project and select **Design Studio**.&#x20;
2. Go to the **Test Case** tab and select the created Test case.&#x20;

{% hint style="info" %}
**Note**: To learn more about how to create a new Test Case Folder and Test Case, [click here](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-test-case-section/creating-test-case.md).&#x20;
{% endhint %}

3. Select **Create Test Step Group** and select **Add new test step group**. The **Test Step Group** dialog opens.&#x20;

<figure><img src="/files/HzjJXN3a4tz53guvnrxd" alt=""><figcaption></figcaption></figure>

4. Enter the name in the **Test Step Group Name** text box.
5. Select **Webservice** as an **Application Type**.&#x20;
6. Select **Create** to add a new Test Step Group. This creates a new **Webservice Test Step Group** inside the Test case.

{% hint style="info" %}
**Note**: You can also add a **Test Step Group** from the [**Reusable Library**](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-test-case-section/creating-test-step-group/add-test-step-group-from-reusable-library.md).
{% endhint %}

<figure><img src="/files/YDTXpdru6U5ALcST1KXF" alt=""><figcaption></figcaption></figure>

## Creating WebService Test Steps

To create WebServices test steps, use one of the following methods:&#x20;

* **Add from Repository** &#x20;
* **Add Manually**&#x20;

<details>

<summary><strong>Adding Elements from Element Repository</strong></summary>

Add from Repository is used to add key–value pair steps required for an API request. The Element Repository stores API elements such as JSON keys, XML keys, form-data fields, and URL-encoded parameters. You can select these elements from the repository and add them directly to the test steps.

To add Webservice elements from the Element Repository to the Test Step Group, perform the following actions:

1. On the **Test Case** tab, select the created Test case.
2. Select **Create Test Step Group** and select **Add new test step group**.
3. Select **Add from Repository**. The **Element Repository** page opens.

<figure><img src="/files/aXHlc7iSpjboN0NjjqO6" alt=""><figcaption></figcaption></figure>

2. Drag-and-drop the **WebService** elements repository into the **Test Step Group**.&#x20;

{% hint style="info" %}
**Note**:&#x20;

* When you drag and drop elements from the **Element Repository** in a **WebService Test Step Group**, all **JSON** and **XML** keys, including parent and nested keys are available in the **Element Name** dropdown. The **Element Name**, **Action** (Keyword), and **Input Value** automatically populate in the test steps.
* When you drag and drop elements for **form-data** or **URL-encoded** from the **Element Repository**, their **key names** are available in the **Element Name** dropdown, and the **Action** is automatically set to **Set Tag Value**.
  {% endhint %}

3. (Optional) Add the required validation steps using appropriate action (for example, Get Header or Get Body) to verify the API response.&#x20;
4. Select **Save** to save the test steps.
5. Select **Debug** to run the test step group.

{% hint style="info" %}
**Note**: To generate reports for the Test Steps, you can create an [**Execution List**](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-execution-section/execute-execution-list.md).
{% endhint %}

<figure><img src="/files/Ra8goyoSG4MefDZpNTNp" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Adding Elements Manually</strong></summary>

The **Add Manually** is used to create and add the required test steps for an API request directly within the test case. This option allows you to manually define the request details, such as JSON keys, XML keys, form-data fields, or URL-encoded parameters, without using the Element Repository.

To add Webservice elements manually to the Test Step Group, perform the following actions:

1. On the **Test Case** tab, select the create Test Case.
2. Select **Create Test Step Group**.
3. Select **Add Manually** to add a new Test Step.

<figure><img src="/files/RL5rWuh6puUVozRSdhZG" alt=""><figcaption></figcaption></figure>

4. Select the **Add Step** (**+**) icon and choose **Add Step Manually** to add more steps to the Test Step Group.

{% hint style="info" %}
**Note**: You can add test steps using the **Add Step (+)** icon in two ways:&#x20;

* From the top corner of the Test Step Group to add a new step.
* By hovering over an individual step, where the **Add Step** (**+**) icon appears next to the Output Value column to insert additional steps within the group.
  {% endhint %}

<figure><img src="/files/Mv05iBYYUyVvNzXfE73a" alt=""><figcaption></figcaption></figure>

5. A new test step is created. Select the **WebService List** as an **Element Type,** and then action from the **Action** dropdown.\
   \
   The following example demonstrates how to configure a WebService API request by setting the endpoint URL, request method, required headers, and executing the request using WebService List actions.\
   \
   To create the test steps required to configure the API request, perform the following steps:
   1. Select **WebService List** from the **Element Type** dropdown.
   2. From the **Action** dropdown, select **Set End Point URL**.
   3. In the **Input Value** text box, enter the required API endpoint URL.
   4. Add another test step and select **Web Service List** from the **Element Type** dropdown.
   5. From the **Action** dropdown, select **Set Method**.
   6. In the **Input Value** text box, enter **GET** to specify the request method.
   7. Add another test step and select **Web Service List** from the **Element Type** dropdown.
   8. From the **Action** dropdown, select **Set Header** (if the API requires headers).
   9. Provide the required header details in the **Input Value** text box (for example, Authorization or Content-Type).
   10. Add another test step and select **Web Service List** from the **Element Type** dropdown.
   11. From the **Action** dropdown, select **Execute Request**.

{% hint style="info" %}
**Note**: This action sends the configured API request to the server and returns the response based on the provided endpoint, method, headers, and other details.
{% endhint %}

6. (Optional) Add the required validation steps using appropriate action (for example, Get Header or Get Body) to verify the API response.&#x20;
7. Select **Save** to save the test steps.

{% hint style="info" %}
**Note**:&#x20;

* After creating the test steps, you can debug the Test Step Group to verify the execution.
* To generate reports for the test steps, you can create an [**Execution List**](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-execution-section/execute-execution-list.md).
  {% endhint %}

<figure><img src="/files/XDmuhzbeNB14KlIrnNV9" alt=""><figcaption></figcaption></figure>

</details>

## Adding WebService Elements in the Test Case Tab

The Add Element feature is available only for WebServices test step groups and is used for form-data and urlencoded requests. It helps you manually add keys inside the test case, where each key is considered as an element. This is useful when you create manual scripts, so you can directly define and use key–value pairs without depending on the Element Repository.

{% hint style="info" %}
**Note**: This feature only works for **form-data** and **urlencoded**.
{% endhint %}

To use **Add Element** in Test Case, perform the following actions:

1. On the **Test Case** tab, go to the **Test Step Group.**
2. In the **Elements** column, select the **+ Add Element**. The **Add element** dialog opens.
3. Enter the **Element name** (Key name) in the text box.
4. Select the **Input Type** (**Text** or **File**) from the dropdown.

{% hint style="info" %}
**Note**:&#x20;

* **If you selected File**: In the **Input Value** text box, you can provide the file path directly or choose the file from a Segregated Avo Storage location.
* **If you selected Text**: In the **Input Value** text box, you can provide the text.

To learn how to add Text or File as an Input Type, [click here](/avo-assure/avo-assure-supported-technologies-for-automation/webservice-automation/element-repository-interface-and-functional-flow/about-the-request-tab.md).
{% endhint %}

5. Select **Add** to create the element.

<figure><img src="/files/bky2EXmsMIE5oXaoHy8G" alt=""><figcaption></figcaption></figure>

6. Enter the tag value in the **Input Value** column.

{% hint style="info" %}
**Note**:&#x20;

* After you add the element, the system automatically selects the **Action** (**Set Tag Value**), and it is not editable.
* You can update the parameter name and its value by selecting the **Edit** icon.
  {% endhint %}

<figure><img src="/files/QdIizPC7Miyodi1wgtCa" alt=""><figcaption></figcaption></figure>

7. Select **Save** to save the created test steps.

#### Key Points to Know

* You can directly create a Test Case and perform API testing without executing any API request from the **Element Repository** page.
* To automate Webservice in Avo Assure, there is no need to capture application elements as APIs work in the backend.&#x20;
* To automate Webservice applications successfully, it is important to understand the correct actions applicable to your application. For a detailed list of supported Webservice list actions, [click here](/avo-assure/actions/web-service-operations.md). &#x20;

**Other Related Links**:&#x20;

* To learn more about how to create and execute an execution list, [click here](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-execution-section.md).&#x20;
* To learn more about how to view the API Test Case execution Reports, [click here](/avo-assure/working-with-the-avo-assure-platform/create-and-execute-tests-with-design-studio/working-with-reports-section.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/avo-assure-supported-technologies-for-automation/webservice-automation/creating-webservice-test-case.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
