Automate Web Browser and Windows Application using Python
Tags: beginners, python, productivity, showdev
Published: 2022-08-22 12:47:14

[Clicknium](clicknium.com) is a free GUI automation Python module. It allows operating Web browser and Windows application.
[Clicknium VS Code extension](https://marketplace.visualstudio.com/items?itemName=ClickCorp.clicknium)

## Why create the wheel?
Many Python automation tools exist, including Selenium, Pyautogui, and Playwright. Some can only manipulate web pages, while others can only manipulate the desktop application. All of them are easy to learn and use. If you chose to use Selenium, you need to learn something like XPath or selector. Learning Pyautogui is simple. However, in order to control the mouse location, you must use the x- and y-coordinates. The resolution change on a computer screen will cause your automation task to fail. Although learning automation tools, such as Selenium and RPA, is challenging, most people find the automation scenarios to be fairly straightforward in their daily job and lives. Learning automation tools takes more time and effort than performing the task manually. A fantastic tool, in my opinion, will be simple and intuitive so that more individuals can benefit from it.

## How simple
Clicknium provides a simple and intuitive API to manipulate UI elements, such as set_text, get_text, click, etc. So the logic of automation code is easy to understand, close to natural language, and functional. How to locate the UI elements as the most difficult problem in automation tasks? To simplify this, we created the Clicknium Recorder. Open the Recorder, and Clicknium will detect the element that the mouse is pointing at automatically. When you click the mouse on the UI element while holding down the Ctrl key, Recorder will immediately grab the element and generate Locator. You can directly get UI elements and operate on them by using Locator directly in your code.  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvrye3d63s77h9tsebye.gif)
Clicknium also supports IntelliSense and auto-complete：  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqvofdppdc5c9r6qhhvv.gif)
## How to try
Prerequisites：
- Windows 7+
- Python 3.7+
- VS Code

### Clicknium Configuration
Search Clicknium in the Visual Studio Code Extension marketplace.  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8x8lk0034a9z2pg6dzc1.PNG)    
Follow the welcome page to finish the configuration.  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kklicr4fhftdjyahnu5y.PNG)  
### How to use Locator:
1. Reference locator directly in your code to get the UI elements and operate it.
2. Rename the locator to a meaningful name and organize it in folders.
3. When the mouse hovers over the code, the snapshot of the UI element corresponding to the locator will be automatically displayed, which can be directly Open, Validate, and Recapture.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mriomduv9u72m5mjey1v.png)  
4. In the Locator store, you can configure the parameters of the locator, verify the validity of the locator, re-capture, and even support real-time Actions to operate the UI element corresponding to the locator and test the functions of the locator.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ic9pza8dgh9helu6g5jb.png)

I suggest following the next step if it's your first try：
Try the Sample on the welcome page to understand how it works.
Take three minutes to finish your: [First Automation Project](https://www.clicknium.com/documents/tutorial/firstautomation)