Open Source APIs for Robot Framework

Markus Stahl
3 min readDec 8, 2020

Starting with software automation you quickly end up on the landing page of some vendor with dooming license fees. The so called “vendor lock”. Robot Framework is an alternative how to keep your freedom of tool choise — and automate anything you want. Without being locked to anyone.

Imagine you want to

  • 𝘰𝘳𝘤𝘩𝘦𝘴𝘵𝘳𝘢𝘵𝘦 Robot Framework
  • provide a 𝘳𝘶𝘯𝘵𝘪𝘮𝘦 𝘦𝘯𝘷𝘪𝘳𝘰𝘯𝘮𝘦𝘯𝘵 for Robot Framework
  • automate some software with Robot Framework through certain open source 𝘈𝘗𝘐s

What components accomplish the task?

Looking at the solution cheat you quickly realize: “Trick question!”. Each component can belong to more than one group. Looking closer you realize: “Double trick question”. All components can be automated through an open source api!!! Let’s have a look how you can achieve that.

RPAFramework

Robocorp is the company breaking the established rpa market dominated by legacy solutions. Robocorp is also “a Python-based stack for automating any repetitive process.” namely free to use robocloud, rpaframework and a great knowledge base with rpa use cases. It is the number 1 address for rpa, especially when you use robot framework as automation engine.

Robocloud is their platform for executing software robots. Rpaframework is a collection libraries for automating components, such as:

Browser

Originally, SeleniumLibrary is probably the main reason popularity of Robot Framework. Robocorp wrapped the orginal library in RPA.Browser library with some own convenient additions.

While Selenium’s popularity there is a new kid on the block, the so called browserlibrary. It is co-developed by Robocorp and based on playwright. Browserlibrary makes automation of browsers more reliable and runs super fast. It is also part of rpaframework since version 7.

Community APIs

Most libraries for robot framework are maintained by the community. Professionals often build their own library around a certain api and publish it under open source licenses.

Camunda

The robotframework-camunda library provides keywords for starting processes in Camunda as well as fetching and completing tasks. The library is based on the generic-camunda-client which is generated from Camunda’s openapi specification.

Kubernetes

There is an official python client for Kubernetes which is auto generated from Kubernetes open api specification. KubeLibrary is a great example how to build a library for robot framework based on this client providing keywords for validating kubernetes deployments.

SFTP

SFTP is not just FTP with extra security. You won’t have any luck automating SFTP access with FTP libraries (such as RPA.FTP), because SFTP uses ssh instead of ftp. The robotframework-sshlibrary is one of the must libraries in every robot framework toolbox making it also possible accessing SFTP servers.

Build your own

Robot Framework libraries often wrappers around other python modules. The easiest library to create is a library accessing a REST API. You can either write keywords sending certain requests to a REST API or generate a python client, if the API provides an openapi specification.

Robocloud

Robocorp provides a Process API with openapi specification for managing execution of software robots. As shown with robotframework-camunda it is fairly easy to wrap keywords around a generated client.

Gitlab

The “better github” offers a vast rest api. However, it still intends publishing an openapi specification. Until then, you have to write keywords directly against the well documented REST API from Gitlab.

Jenkins

If you are still using Jenkins, you can write an API wrapping available pyhton clients such as python-jenkins. Or use the robotframework-jenkins library.

In Summay

Basically anything can be automated with Robot Framework. The effort makes the difference. If a ready to use library like rpaframework is available, automation is very easy. If there is no ready to use library there likely is a general python module already containing the functionality you want. You only have to wrap your library around that python module. If there is no module, yet, but your component has a REST API, you may generate your ready to use python client and wrap it a library.

Agree? Disagree? You don’t like trick questions? Let the internet know in the comments what i have missed.

--

--

Markus Stahl

Sustainable automation with open source technologies.