Skip to main content

First Automation Project


In this tutorial, we will work through a simple Clicknium automation script from zero to help you get familliar with Clicknium. This script will open a Chrome browser and google 'Clicknium'.


Please follow Quick Start first to install Clicknium and related extensions.

Create a Python file

Following code will open a Chrome browser and get into Google website. (Make sure Clicknium Chrome Extension is ready.)

from clicknium import clicknium as cc, locator

def main():
tab ="")

if __name__ == "__main__":

Capture first UI locator

In the next step, we need to use Locators to identity the UI element that we want to operate. Clicknium Recorder will help to catpure locators.

  • Click Capture button in LOCATORS tab of Explorer side bar or pressing `Ctrl+F10 for shortcut in VS Code.
  • Clicknium Recorder will pop up.
  • Hover mouse over the Google Search bar, it will be highlighted with a rectangle.
  • Press Ctrl+Click to capture locator for the target element, the locator will be added to the Locator Store listing in the tree area of Clicknium Recorder.
  • Capture search button with the same approach.
  • Click Complete button.
    show locator

First line automation code

After capturing UI locators, use Clicknium automation API and locators to input text into search bar and click search button.

  • reference locators in code by starting locator. , the following node will be listed in syntax popup for you to select and autofill.

You can add a line of sleep(3) to avoid VS Code shutting down the browser too quickly. For more about automation API, refer Clicknium Python package documents.
use locator

Run/Debug automation code

  • Open related Python file, run this script by Ctrl+F5.
  • Open related Python file, debug this script by F5.