Home » Web Development » TagUI: an Excellent Open Source Option for RPA – Introduction

About Guglielmo Iozzia

Guglielmo Iozzia
Guglielmo is currenty a Big Data Delivery Lead at Optum Ireland. He has been a software engineer and architect for a variety of Java and Scala applications (Big Data, web, cloud, web services, mobile). Since 2018 he is also a frequent speaker to international conferences. His first technical book is going to be published in December 2018

TagUI: an Excellent Open Source Option for RPA – Introduction

Today I want to introduce TagUI, an RPA (Robotic Process Automation) Open Source tool I am using to automate test scenarios for web applications. It is developed and maintained by the AI Singapore national programme. It allows writing flows to automate repetitive tasks, such as regression testing of web applications. Flows are written in natural language: English and other 20 languages are currently supported. Works on Windows, Linux and macOS.
The TagUI official documentation can be found here.
The tool doesn’t require installation: just go the official GitHub repository and download the archive for your specific OS (ZIP for Windows, tar.gz for Linux or macOS). After the download is completed, unpack its content in the local hard drive. The executable to use is named tagui (.cmd in Windows, .sh for other OS) and it is located into the <destination_folder>/tagui/src directory.
In order to use it, the Google Chrome web browser needs to be installed.

Photo by Dinu J Nair on Unsplash

TagUI scripts are plain text files that require just the .tag extension to their names. A TagUI script is referred as flow, because it contains the actions that need to be automated and their execution order.
Here’s a quick reference to the principal TagUI steps available for web applications RPA:

  • click: Click on any element, region of image of a web page.
  • visit: Navigation to a web page. It can be omitted and it is possible to simply specify the URL of the destination web page.
  • type: Input text into web input fields.
  • assign: Assign a value to a variable.
  • read: Save text from web elements or screen into a variable.
  • if…else: The usual if…else statement common to any programming language.
  • for: The usual for loop common to any programming language.
  • select: Selection of a dropdown option.
  • table: Save HTML content to a CSV file.
  • popup: Execution of steps in a new tab.
  • frame: Execution of steps in a frame.
  • download to: Specify a location to store downloading files.
  • upload: Upload a file to a website.
  • snap: Take a screenshot of a web page or element.
  • echo: Print a message to the command line.
  • show: Show element text to the command line.
  • check: Validate something.
  • wait: Pause execution for some time.
  • //: Add a comment.

Steps interact with web elements through identifiers, which include web identifiers, image snapshots, screen coordinates. The following is an example of a full TagUI flow to perform a search in Google.com:

// Visit google.com
https://www.google.com
 
// Look on the web page for an element with 'q' in its text, id or name
// and type the search text TagUI RPA, then Enter
type //*[@name="q"] as TagUI RPA[enter]
 
// Click the first result using XPath
click (//*[@class="g"])[1]//a
 
// Wait 3 seconds so the page can load
wait 3
 
// Save a screenshot of the web page to top_result.png
snap page to top_result.png

TagUI flows can be executed in the following modes:
    • Browser based: an instance of Chrome is started and it is possible to visually watch everything happening at flow execution time.
    • Headless: flow execution happens in the background with no visible browser.
    • No Browser: flow execution without any browser (suitable for automation in machines with no browser nor graphical interface).

Execution logs can be generated in text or HTML format.

My personal feedback on this tool. Definitely it is easy to use and gives the possibility also to people having no technical background to automate tasks. No major drawbacks so far. The documentation is comprehensive in terms of steps syntax and general practices, but lacks complex examples, so when applying flows to web applications implemented using modern web frameworks some practices can only be learned by trial and error. The live mode execution helps a lot in those situations.

In a future post I will share some tips about few particular situations I have met when using it.

Published on Java Code Geeks with permission by Guglielmo Iozzia, partner at our JCG program. See the original article here: TagUI: an Excellent Open Source Option for RPA – Introduction

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments