Taiko – Test like a user, not like a programmer

I met one of the key contributors on Taiko in the Selenium Conf 2019, London. He just told me to try the tool once and when I did, it blew my mind away!

Its architecture is simple but powerful. It is mainly designed for keeping the end-user in mind.

From Taiko’s website –

Taiko is a free and open source browser automation tool built by the team behind Gauge by ThoughtWorks.

Writing tests are very simple in Taiko. Just write the automated tests on-the-goo. Using Taiko, we can write the test scripts without inspecting the source page code.

Example, to click a ‘Login’ button, just use –

click("Login")

With its in-built Implicit Wait Mechanism, Taiko can automatically wait for page loads and ajax calls.

Features:

  • Smart Selectors
  • Ability to handle XHR and dynamic content
  • Request/Response stubbing and mocking

Installation:

1. Install NodeJS as a pre-requsite

2. Run –

npm install -g taiko

A simple example –

Test Script written in JavaScript Code

var browser = new webdriver.
                 Builder().
                 usingServer().
                 withCapabilities({'browserName': 'chrome' }).
                 build();

browser.get('http://www.google.com');

// Uses HTML locators, elements, form submissions etc.
browser.findElement(webdriver.By.name('q')).sendKeys('gauge test automation');
browser.findElement(webdriver.By.name('btnG')).click();

Test Script written in Taiko

openBrowser()
goto(“https://www.google.com”)

// API for testing like a user
write(‘gauge test automation’)
press(‘Enter’)

It’s that simple.

Code Export:

Taiko has a feature of exporting the successful commands into a javascript file. Just run after scripting –

.code

Integration:

Taiko can be easily integrated with Mocha, Jest and Gauge.

Short Demo:

Conclusion:

Taiko is an excellent tool for business testers and manual testers who has very less coding knowledge. It’s awesome and time saving too.

References:

  1. https://taiko.gauge.org/
  2. https://gauge.org/2019/08/21/how-taiko-compares-to-other-browser-automation-tools/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: