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.
You mean a web API that executes robot test cases?
No, what I mean is creation of Web APIs using Robot Framework.
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.
1 Like
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.
2 Likes
Hello Dave & Markus,
Many thanks for your response and sharing your thoughts, it helps a lot.
Regards,
Omprakash.