Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added doc for Invoking SOAP APIs #414

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion src/pages/docs/test-cases/create-steps-restapi/api-resquest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "API Request"
page_title: "Add API Request in RESTful API in Testsigma"
metadesc: "Add API Request in RESTful API | Run your request with the help of the URL, method, and other optional values such as parameters, body, headers, and authorization"
metadesc: "Configuring API test steps made easy with Testsigma low code automation tool | Learn how to add API test steps to your Test Cases in Testsigma"
noindex: false
order: 4.92
page_id: "Add API Request in RESTful API"
Expand All @@ -19,6 +19,9 @@ contextual_links:
- type: link
name: "Supporting Other Unicode Characters"
url: "#supporting-other-unicode-characters"
- type: link
name: "Invoke SOAP APIs"
url: "#invoke-soap-apis"
---

---
Expand Down Expand Up @@ -60,4 +63,86 @@ Here is a quick gif demonstrating how to add Unicode in RESTful API.
[[info | NOTE:]]
| To enter Unicode characters, copy & paste the characters into the required field.

---

## **Invoke SOAP APIs**

In Testsigma, users can also invoke SOAP APIs by adding an API test step in the test case. Follow the steps below to create SOAP APIs in test steps.

### **Steps to Invoke SOAP APIs**

1. From the **Dashboard**, navigate to **Create Tests > Test Cases**, create a test case by clicking on **Create Test Case**.
![Test Cases](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapinav.png)


2. Select the option on the left side of the test step, and then choose **API** from the panel.
![API Step](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapiapits.png)


3. Click on the test step to create the API step.
![Add API Test Step](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapichtaapi.png)

<br>

<details style="border: 1px solid gray; border-radius: 4px; padding: 0.5em; margin: 0.5em 0; background-color: #f2f2f2;">
<summary style="color: darkgreen; font-weight: bold; list-style: none; font-size: 1em; cursor: pointer;" onclick="if(this.parentNode.open) this.parentNode.style.border='1px solid gray'; else this.parentNode.style.border='none';">
<span style="margin-right: 5px;">📘</span>Example SOAP API:
</summary><br>
Let's retrieve a list of countries using SOAP API.
<br><br>
🔍 <b>Request Configuration:</b><br>
<ul style="font-size: .8em;">
<li><b>Type:</b> POST</li>
<li><b>Endpoint:</b> http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso</li>
</ul>

<br>
📝 <b>Request Body (XML):</b><br>
<div style="position: relative;">
<pre style="white-space: pre-wrap; font-size: .8em;"><code id="xmlCode">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"&gt;
&lt;soap12:Body&gt;
&lt;ListOfCountryNamesByName xmlns="http://www.oorsprong.org/websamples.countryinfo"&gt;
&lt;/ListOfCountryNamesByName&gt;
&lt;/soap12:Body&gt;
&lt;/soap12:Envelope&gt;</code></pre>
</div>

<br>
🔑 <b>Headers:</b><br>
<ul style="font-size: .8em;">
<li><b>Key:</b> content-type</li>
<li><b>Value:</b> text/xml; charset=utf-8</li>
</ul>
</details>

<script>
function copyToClipboard(elementId) {
var copyText = document.getElementById(elementId);
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(copyText);
selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
selection.removeAllRanges();
alert('XML code copied to clipboard!');
}
</script>


<br>

4. Enter the above example details in the API test step.
![API Details](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapidetails.png)


5. Click on **Send** and verify the **Response**.
![Send Request](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapisend.png)


6. Click on **Create** to save the test step.
![Create API](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/sapicreate.png)


---
Loading