# Creation of API using Robot Framework

**URL:** https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953
**Category:** Robot Framework
**Created:** [17 June 2021 05:22 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953 "2021-06-17T05:22:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rtomprakash](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rtomprakash](https://forum.robotframework.org/u/rtomprakash)
#### Post date: [17 June 2021 05:22 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/1 "2021-06-17T05:22:42Z")

</div>

Hi,

While I have used Robot Framework for automation testing of APIs, wondering if it has capability to create Web APIs with endpoints.

I am aware that there are Python based frameworks (like Flask) which can be used for creation of Web APIs but still wanted to know if Robot Framework has any keywords/capabilities built-in for API creation.

Appreciate inputs / suggestion!

Thanks,  
rtomprakash2019.

---

<div class="post-metadata">

### Author: ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)
#### Post date: [17 June 2021 16:21 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/2 "2021-06-17T16:21:57Z")

</div>

You mean a web API that executes robot test cases?

---

<div class="post-metadata">

### Author: ![rtomprakash](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rtomprakash](https://forum.robotframework.org/u/rtomprakash)
#### Post date: [17 June 2021 17:18 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/3 "2021-06-17T17:18:57Z")

</div>

No, what I mean is creation of Web APIs using Robot Framework.

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [18 June 2021 01:30 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/4 "2021-06-18T01:30:20Z")

</div>

Hi Omprakash,

Like Markus, I’m not really sure what you are asking for, but i’ll try to clarify if you are asking what I think?

So without any test tools, your API application looks something scenario 1, and you are saying you have succeeded to test scenario 2, and now you would like to test scenario 3?

| Sccenario | Client | Connection | API Server |
| --- | --- | --- | --- |
| 1 | Your client application,   
which could be javascript in a browser   
 a desktop application  
or some other application server | → | Your API server on your application under test |
| 2 | robot framework API tests | → | Your API server on your application under test |
| 3 | Your client application,   
which could be javascript in a browser   
 a desktop application  
or some other application server | → | robot framework API tests |

Hopefully i’ve understood you correctly? If so this is usually called stubbing where you create a stub interface to simulate the real api interface for a test environment.

I don’t know if robot framework has the capability to create stub test cases, I’ve not seen any examples of it, but I’ll let others answer if there are existing libraries for creating stubs.

You can create your own python keywords, so it’s possible that you could create your own python keywords to create a web service using the python http.server module and receive api calls with it, so if there are no existing libraries to create stubs, you could create one.

Hope i’ve understood your question and provided a helpful answer,

Dave.

---

<div class="post-metadata">

### Author: ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)
#### Post date: [18 June 2021 18:55 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/5 "2021-06-18T18:55:40Z")

</div>

So your idea is to basically describe the webservice with robot Framework keywords, right?

Interesting thought. So instead of python code and fancy decorators one would describe endpoint with keywords.

I don’t think there is anything available to achieve that.

Furthermore you would have to solve the execution problem. RF suites are one-time running processes. They are executed and finished. A Webservice needs to be constantly available and listening.

---

<div class="post-metadata">

### Author: ![rtomprakash](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rtomprakash](https://forum.robotframework.org/u/rtomprakash)
#### Post date: [19 June 2021 05:34 UTC](https://forum.robotframework.org/t/creation-of-api-using-robot-framework/1953/6 "2021-06-19T05:34:47Z")

</div>

Hello Dave & Markus,

Many thanks for your response and sharing your thoughts, it helps a lot.

Regards,  
Omprakash.
