Step 1. Check if you have Java installed
- First, make sure that you have setup TagUI-Python on your Windows 10 machine, as outlined in the article: Set up TagUI-Python on Windows 10.
- TagUI visual automation requires Java libraries. Let's do a check to see if you have Java installed on your machine. In the Terminal window, type the following command:
- If you see the screen below, then you have Java installed on your machine. Please proceed to Step 3. Setup TagUI - Visual Automation.
java -version
If you see the following message instead, then please continue to install Java on your machine.
Step 2. Install OpenJDK
- Go to: https://openjdk.java.net/, and follow the link to the download section. At the time of writing the latest Oracle OpenJDK release was version: 15.0.1
- Click and download the zip file for Windows / x64.
- Unzip the file. Depending on the latest Java version that you downloaded, you should see a folder similar to jdk-15.0.1.
- Move the folder to a directory of your choice. However, it is recommended you pick a directory path that does not contain spaces e.g. C:\jdk-15.0.1.
- Follow the steps in the article: How to Add New Environment Variables in Windows 10
- Under System Variables, click
New
- Enter Variable name as JAVA_HOME
- Enter Variable value as the your OpenJDK folder e.g. C:\jdk-15.0.1
- Click the
OK
button: - Double-check that JAVA_HOME has been added to the system environment variables:
- Now follow the steps in the article: How to add path to the %PATH% environment variable in Windows 10 to add the following path to the %PATH% environment variable:
- Select Path in the System Variables and click
Edit
- Click
New
- Add the following path: %JAVA_HOME%\bin
- You should have something like this:
- Click the
OK
button:
3. Setup TagUI with Visual Automation
- Start python in a Command Prompt. Once you are in Python, type the following:
- If everything runs ok, you will see a True displayed as shown below.
- If this is the first time you run visual automation, most likely you will see the following warning message. This is ok, as long as you see True displayed as shown above.
import tagui as t t.init(visual_automation = True, chrome_browser = False)
4. Test TagUI with Visual Automation
- Copy the following 5 lines and paste them direct into the Python interpreter:
- If everything runs ok, the bot will hit the
Win
key, launch the notepad and enter the text hello! as shown below:
t.keyboard('[win]') t.wait(1) t.keyboard('notepad[enter]') t.keyboard('hello!') t.wait(1)
Note: Copy and paste ALL the 5 lines together, and not one by one. This is because right after the Win
key is pressed, you want the bot to enter notepad direct into the Windows search field.
If you copy one by one, you will see notepad entered in your Python window, which is not what you want. Your command prompt should look like this:
Congratulations! You have successfully setup Visual Automation in TagUI!
Add comment