Start your own scalable robot automation.

A robot that can draw!
  1. The repeated task with consistent accuracy and quality
  2. Perform multiple tasks parallelly
  3. Connect to legacy system via APIs.
  4. Scalable processing.

Bots don’t know how to deal with an unknown scenario. They don’t even know if they did something wrong.

RPA in action: Drawing symmetrical shape in MS-Paint.

Good practice to design an RPA (robotic process automation)

Task Design

  • Limit the task length and break it into series of smaller preemptable tasks.
  • Smaller decoupled tasks will increase parallelism.
  • Set expectations rigid. Teaching bots about right or wrong is a long term investment. Instead, assert the task.
  • Keep frequent check-point, keep exporting and saving data after each data modification.

Deterministic UI interactions

  • Prefer to use tab-sequence instead of click. Clicking buttons will require to have bookkeeping of coordinates which are more prone to Err.
  • Use short-keys and function-keys, for the above-mentioned reasons.

Consume UI feedback

  • Instead of waiting for a specific hard-coded time task post every action (click, key-stroke), wait till the feedback in UI like the opening/closing of window or dialog box.
    Hence, Avoid the use time.sleep
  • Use active window title as an assertion for flow. For example, in most software ctrl+s should open window with title Save As.
RPA.hotkey(('ctrl', 's'))
# Bad practise: since task can take more than 120 seconds.
time.sleep(120)
# Good practise: time.sleep till active window gets "Save As"
RPA.waitForWindow(title="Save As")

RPA.typewrite("101010.png")
RPA.hotkey(('alt', 's'))
Saving generated file

Consider external factors

  • Change in UI
  • Change in tab sequences
  • Any window interruptions

Project Structure

  • rpa.py
    Encapsulation class for PyAutoGUI library. Encapsulation makes the dependency on third-party libraries lose.
  • paintApp.py
    Context-aware implementation for the automation of the app. Store business logic to perform the app-related tasks.
  • main.py
    The main caller of the app module could be either the consumer, worker-pool or as micro-service depending on the infra design.

Connecting with a scalable architecture

Horizontally scalable worker pool
  1. Find the complete project on GitHub: https://github.com/arinkverma/rpa-draw
  2. Read about PyAutoGUI, automation kit for Windows: https://pyautogui.readthedocs.io/en/latest/mouse.html

--

--

--

Code, arts, process and aspirations. co-Founded GreedyGame | IIT Ropar. Found at www.arinkverma.in

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Trying Project Euler

How to Eat For Abs (In 2 Easy Steps)

Basics of PHP

How to Keep Engaged with Your Team

The hyperexponential bloom: upgrading the economy to an open operational system

Error 1 error MSB8020: The build tools for v142 (Platform Toolset = ‘v142’) cannot be found.

Kubernetes Lab with KVM

LESSON 9 : 9.2 App Settings

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Arink Verma

Arink Verma

Code, arts, process and aspirations. co-Founded GreedyGame | IIT Ropar. Found at www.arinkverma.in

More from Medium

What are DeFi Tokens? What are the top DeFi tokens in the marketplace?

Privacy Guardian: Your Ultimate Guide to Safeguarding Your Smartwatch Privacy

A poster of our website Privacy Guardian that reads “learn, secure, and update”

2021 Year in Review

Troubleshooting Intra-Org SMTP Traffic Issues (and disabling Cisco ASA ESMTP Inspection)