Build your first automation with AskUI in minutes.
In this quickstart tutorial, we’ll guide you through creating your first automation with AskUI. We’ll create a simple script that searches for a product on Amazon and adds it to the cart.
1
Install AskUI Agent OS
First, download and install the AskUI Agent OS for your operating system:
Download the appropriate installer for your system:
set ASKUI_WORKSPACE_ID=<your-workspace-id>set ASKUI_TOKEN=<your-token>
4
Create Your First Automation
Create a new Python file amazon_shopping.py and add the following code:
Copy
from askui import VisionAgentimport loggingfrom askui import locators as locfrom askui.reporting import SimpleHtmlReporter# Initialize your agent with logging and reportingwith VisionAgent( log_level=logging.DEBUG, reporters=[SimpleHtmlReporter()]) as agent: # Open Amazon website agent.tools.webbrowser.open_new("http://www.amazon.com") agent.wait(3) # Wait for page to load # Search for a product agent.click(loc.Element("textfield")) agent.type("nike shoes") agent.keyboard('enter') agent.wait(2) # Wait for search results # Verify page contents page_status = agent.get("Are Nike shoes visible on the screen?") print(f"Cart Status: {page_status}")
Run the script:
Copy
python amazon_shopping.py
The script will:
Open Amazon in your default browser
Search for “nike shoes”
Verify the cart contents
Generate an HTML report of the automation
5
Understanding the Code
Let’s break down the key components:
Agent Initialization
Copy
with VisionAgent(log_level=logging.DEBUG, reporters=[SimpleHtmlReporter()]) as agent: