Getting Started with Opress

Three simple functions. Infinite possibilities.

import opress

click(image("button.png"))
find(text("Hi, mom!"))

That's literally it. See something? Click it. Need text? Find it.

🪄 The Magic of Simplicity

Forget complex frameworks. Opress works exactly how you think it should:

👀

See It

image("login.png")
👆

Click It

click(...)

Done

find(text("Success!"))

1. Installation (30 seconds)

pip install opress

That's it. No configuration files, no setup wizards, no dependencies to manage.

2. Your First Script (2 minutes)

Here's a complete login automation in just a few lines:

import opress

# Find and click login button
click(image("login_button.png"))

# Fill the form
click(text("Username"))
write("john_doe")
press("tab")
write("password123")

# Submit and verify
click(text("Login"))
find(text("Welcome back!"))

No classes to instantiate, no drivers to configure, no complex selectors. Just see it and automate it.

3. Key Concepts

Visual Recognition

Opress finds elements by their visual appearance, not by HTML or code structure. This works with any application.

Coordinate-Based Actions

All interactions happen at specific screen coordinates. Find elements first, then interact with them.

Wait States

Built-in waiting for elements to appear. No need to manually add sleep statements in most cases.

Cross-Platform

Same code works on Windows, macOS, Linux, and even remote devices via VNC.

4. Common Automation Patterns

🎯 Direct Click Pattern

# The Opress way - simple and direct
click(image("button.png"))
click(text("Submit"))

No variables, no if statements. Just click what you see.

📝 Form Filling Made Easy

# Chain actions naturally
click(text("Username"))
write("john_doe")
press("tab")
write("password123")
click(text("Login"))

Reads like English, works like magic.

✅ Smart Verification

# Verify success instantly
find(text("Welcome back!"))
find(image("dashboard.png"))

Built-in waiting. No sleep statements needed.

🔄 Real-World Example

# Complete workflow in 4 lines
click(image("email_app.png"))
click(text("Compose"))
write("Hi, mom!")
click(text("Send"))

Any app, any platform, same simple syntax.

5. Best Practices

✅ Do

  • • Use high-quality PNG images for templates
  • • Test with different confidence levels
  • • Use regions to limit search areas
  • • Add assertions for critical steps
  • • Handle cases where elements aren't found

❌ Don't

  • • Use compressed or low-quality images
  • • Assume elements will always be found
  • • Use fixed sleep times instead of waiting
  • • Search entire screen when region works
  • • Ignore permission requirements

Next Steps