An AI-powered autonomous testing tool that uses Playwright, LangGraph, and Google's Gemini models to navigate and verify web applications just like a human tester.
Traditional QA automation is brittle and requires constant maintenance when UI changes. The Autonomous QA Agent solves this by using Generative AI to:
- Understand Goals: Not just selectors. You give it a high-level goal (e.g., "Verify the login fails with wrong credentials"), and it figures out how to do it.
- Self-Correct: If an action fails or the page state changes unexpectedly, the agent re-plans its next step.
- Visual Verification: Uses Gemini Vision to "look" at the page and confirm if an action had the intended effect or if the goal was achieved.
The agent runs on a state machine built with LangGraph. Every cycle involves three main stages:
- Planning: The agent analyzes its history and the current page to decide the next best action.
- Execution: It uses Playwright to interact with the browser (click, fill, navigate, etc.).
- Verification: It captures "before" and "after" screenshots and uses Gemini Vision to verify the success of the action and check if the overall goal is met.
graph TD
Start((Start)) --> Planner[Planner Node]
Planner -->|Next Action| Executor[Executor Node]
Executor -->|Action Result| Verifier[Verifier Node]
Verifier -->|Goal Met| End((END))
Verifier -->|Goal Not Met| Planner
| Directory/File | Description |
|---|---|
app/agent/ |
Core logic: nodes.py (logic), graph.py (flow), state.py (memory). |
app/tools/ |
Browser capabilities: navigation.py, observation.py, wait.py. |
app/core/ |
Infrastructure: config.py (env), database.py (SQLAlchemy/SQLite). |
app/models/ |
Database schema: db.py (TestRuns and TestSteps). |
app/main.py |
FastAPI entry point and API endpoints. |
screenshots/ |
Storage for visual proof captured during test runs. |
- Python 3.10+
- A Google Gemini API Key
# Clone the repository
git clone https://github.com/ArpitK24/Autonomus-Agent-Agentic-workflow-.git
# Install Python packages
pip install fastapi uvicorn playwright langchain langgraph langchain-google-genai sqlalchemy aiosqlite python-dotenv google-generativeai
# Install Playwright browser
python -m playwright install chromiumCreate a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
HEADLESS=False# Set PYTHONPATH to root and run uvicorn
$env:PYTHONPATH="."; python -m uvicorn app.main:app --port 8000 --host 0.0.0.0Send a POST request to /api/v1/run-test:
{
"url": "https://www.google.com",
"goal": "Verify the search bar is present and accessible"
}- Console: Live updates of the agent's thoughts and actions.
- Database: Check
qa_agent.dbfor a full history of runs and steps. - Visuals: Review the
screenshots/folder for UUID-labeled images of every interaction.
- FastAPI - Backend Framework
- LangGraph - Agentic Orchestration
- Playwright - Browser Automation
- Gemini 2.0 Flash - Multimodal AI Intelligence
- SQLAlchemy - Database ORM