Skip to main content

Test Automation using AI Agents

Project description

auto-browse

Test Automation using AI Agents. A Python package for AI-powered Test automation using Playwright.

Website and Documentation

Installation

With pip:

pip install auto-browse

Install playwright:

playwright install --with-deps

Add your API keys to your .env file:

OPENAI_API_KEY=your_api_key_here
GEMINI_API_KEY=your_api_key_here
ANTHROPIC_API_KEY=your_api_key_here

Set the following environment variables:

AUTOBROWSE_ANONYMIZED_TELEMETRY=true
ANONYMIZED_TELEMETRY=false
BROWSER_USE_LOGGING_LEVEL=info

Features

  • AI-powered browser automation
  • Supports OpenAI, Gemini, Ollama, Groq, Mistral, Anthropic Claude
  • Built on top of Playwright
  • Support for common browser actions like:
    • Google search
    • Navigation
    • Clicking elements
    • Form input
    • Tab management
    • Content extraction
    • Scrolling
    • Keyboard input
    • Dropdown interaction

Usage

import asyncio
from playwright.async_api import async_playwright
from browser_use.browser.browser import Browser, BrowserConfig
from auto_browse.browse.browse import AutoBrowse

async def main():
    async with async_playwright() as p:
        browser = Browser(config=BrowserConfig(headless=False))
        # To use other models, replace the model name with the desired model
        # e.g., "openai:gpt-4o-mini", "ollama:llama3.1", "google-gla:gemini-1.5-flash", groq:gemma2-9b-it, mistral:mistral-large-latest
        auto_browse = AutoBrowse(browser=browser, model="openai:gpt-4o-mini")
        page = await auto_browse.get_current_page()
        await asyncio.sleep(1)

        # This can run one specific step, not like two steps combined
        await auto_browse.ai("Search for 'Python automation' on Google")
        await auto_browse.ai("Click on the first search result")

        await browser.close()

if __name__ == "__main__":
    asyncio.run(main())

Save the above code in a file (e.g., example.py) and run it:

python example.py

Jupyter Notebook Usage

You can also use auto-browse in a Jupyter notebook:

# Cell 1: Setup
import nest_asyncio
import asyncio
nest_asyncio.apply()

from browser_use.browser.browser import Browser, BrowserConfig
from browser_use.browser.context import BrowserContextConfig
from auto_browse.browse.browse import AutoBrowse

browser = Browser(config=BrowserConfig(headless=False))
auto_browse = AutoBrowse(browser=browser, model="openai:gpt-4o-mini")
page = await auto_browse.get_current_page()
await asyncio.sleep(1)

# Cell 2: Search
await auto_browse.ai("Search for 'Python automation' on Google")

# Cell 3: Click result
await auto_browse.ai("Click on the first search result")

# Cell 4: Cleanup
await browser.close()

Requirements

  • Python 3.11+
  • Playwright
  • browser-use
  • Other dependencies as specified in pyproject.toml

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_browse-0.0.3.tar.gz (144.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_browse-0.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file auto_browse-0.0.3.tar.gz.

File metadata

  • Download URL: auto_browse-0.0.3.tar.gz
  • Upload date:
  • Size: 144.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for auto_browse-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7ab600147ff2e58fe539e9a8c99d94a7800607fda772c24d56b9cf88f195bee1
MD5 9d12cc2e2290dc91fd489e8499355d6f
BLAKE2b-256 93f5bc32628d15f3a457e977969821460b56c5da21bb3535e5c15cbae31e5aaf

See more details on using hashes here.

File details

Details for the file auto_browse-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: auto_browse-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for auto_browse-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c04f3c7fd560f5ee1d1bf41fd77c796e1f870fce4150895e3e2e2353434d57
MD5 b694ebfbb42adda9140abf0f9654dd4b
BLAKE2b-256 474249036639456d20537a95fed92bd8e97e12c7db46cf2727e37f27fdce8e44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page