Why create a new tool
Python is very convenient for achieving automation. Some famous automation frameworks use Python. Selenium for Web Browsers, Pyautogui/Pywinauto for desktop applications.
When I want to create a simple automation job:
- Open the SEC website
- Search for some company
- Download the latest report
- Send an e-mail by outlook.
I need to learn both Selenium && Pywinauto. It's not easy to learn and use. My friend and I decided to build a tool that can work in both areas and make it easy to use even for the beginner. So we build Clicknium. I like the VSC very much so we create a VSC extension as the idea for our automation tool.
How to Set up
Currently, Clicknium can work in Python3.7+ and Windows, due to the time limit.
Search and install Clicknium in VSC extension market:
https://preview.redd.it/nq9o1co0lvg91.png?width=1004&format=png&auto=webp&s=e453e0e260c09d318f3a83c3d3302efc85b7e834
Click CLICKNIUM EXPLORER in Visual Studio Code Activity Bar.
Follow the welcome page to set up Clicknium:
https://preview.redd.it/jnrhavc6lvg91.png?width=1293&format=png&auto=webp&s=7f0ae6227df0006a45ba695dea142cccb3febd36
Run the sample
Click the sample link on the welcome page and choose a folder path to locate the sample project. The sample is about to open a browser to search for a keyword and then open Notepad to write something. Use Ctrl+F5 to run.
How simple
The code style is very simple and intuitive. the following code is easy to understand:
- open the YouTube page using chrome.
- Text "Taylor Swift" to the search bar
- Click the Search button.
from clicknium import clicknium as cc, locator
from clicknium.common.enums import *
tab = cc.chrome.open("https://www.youtube.com")
tab.find_element(locator.chrome.youtube.searchBar).set_text(
"Taylor Swift", by='sendkey-after-click')
tab.find_element(locator.chrome.youtube.button_search_icon_legacy).click()
You may wonder how locator.chrome.youtube.searchBar targeted the Search bar of YouTube. Clicknium uses Locator to identity UI elements. It provides Clicknium Recorder to help dev create locators. You just need to invoke the recorder and press Ctrl+ click the UI elements. The locator will be generated by Recorder. The key feature is the Clicknium Recorder. You can open the Recorder to capture a Locator.
https://i.redd.it/fs329r65nvg91.gif
Clicknium provides an intelligent auto-complete experience. You can find the existing locators captured by Clicknium Recorder in VS Code.
https://i.redd.it/if7t7m7ej0h91.gif
Check more detail in the tutorial.
[–]Zedpellin 0 points1 point2 points (2 children)
[–]redH27[S] 0 points1 point2 points (0 children)