Skip to main content

Robot Framework library for Alumni (Alumnium)

Project description

AlumniRobotLibrary

Python 3.7+ Robot Framework License: MIT PRs Welcome

AI-Powered Robot Framework Library for Alumnium

Bridge the gap between natural language and test automation

Overview

AlumniRobotLibrary is an AI-powered Robot Framework library that seamlessly integrates Alumnium into your test automation workflow. Write test steps in plain English and let AI handle the complexities of web automation.

Key Features

  • Multiple Automation Backends: Full support for both Selenium and Playwright
  • Cross-Browser Testing: Run tests on Chrome, Firefox, WebKit, or Chromium
  • Flexible AI Integration:
    • OpenAI (GPT-4o, etc.)
    • Anthropic (Claude models)
    • Google (Gemini)
    • DeepSeek
    • Ollama & Self-hosted LLMs
  • Natural Language Commands: Write test steps as you would explain them to a human
  • Self-Healing Actions: Robust against UI changes and selector modifications
  • Dynamic Test Data Generation: Create realistic user profiles, accounts, addresses, and more
  • Comprehensive Diagnostics: Automatic screenshots and HTML capture on test failures
  • AI-Powered Error Analysis: Get intelligent explanations and fix suggestions for test failures
  • Extensible Framework: Easily register custom Python functions as keywords

Installation

pip install alumnium selenium playwright faker robotframework alumnirobotlibrary
playwright install

Quick Start

*** Settings ***
Library    AlumniRobotLibrary.py    backend=playwright    browser=chromium    headless=True    ai_provider=openai    ai_model=gpt-4o    api_key=YOUR_OPENAI_API_KEY

*** Variables ***
${LOGIN_URL}    https://practicetestautomation.com/practice-test-login/

*** Test Cases ***
Login With Dynamic User Profile
    [Documentation]    Generate a full user profile and attempt login using AI-powered keywords.
    ${user}=    Generate Test Data    user
    Open Browser And Init Alumni    ${LOGIN_URL}
    Alumni Do    enter ${user['username']} into username field
    Alumni Do    enter ${user['password']} into password field
    Alumni Do    click the login button
    Alumni Check    page contains error message
    Alumni Quit

Usage Guide

Configuration Options

Parameter Description Default Example Values
backend Automation backend to use selenium selenium, playwright
browser Target browser chrome chrome, firefox, webkit, edge
headless Run in headless mode False True, False
ai_provider LLM provider for AI capabilities openai openai, anthropic, google, ollama
ai_model Specific model to use (optional) provider default gpt-4o, claude-3-haiku, gemini-pro
api_key API key for chosen provider None YOUR_API_KEY
api_base Custom API endpoint (for self-hosted) provider default http://localhost:11434
screenshot_dir Directory for diagnostics files alumni_failures test_artifacts, screenshots

Core Keywords

Keyword Description Example
Open Browser And Init Alumni Start browser and initialize Alumnium with URL Open Browser And Init Alumni https://example.com
Alumni Do Execute an action using natural language Alumni Do click the submit button
Alumni Check Verify a condition using natural language Alumni Check page title is "Welcome"
Alumni Get Retrieve a value using natural language ${text}= Alumni Get text of welcome message
Generate Test Data Create realistic test data of specified type ${user}= Generate Test Data user
Register Custom Keyword Add your own Python function as a keyword Register Custom Keyword my_keyword ${my_function}
Alumni Quit Close browser and clean up Alumni Quit

Advanced Features

AI-Powered Error Diagnosis

When a test fails, AlumniRobotLibrary can automatically:

  1. Capture a screenshot and HTML of the page
  2. Analyze the failure using AI
  3. Provide detailed explanations and potential fixes
[AlumniRobotLibrary] Failure in alumni_do('click the login button'):
ElementNotFoundException: Could not find element matching criteria

📸 Screenshot: alumni_failures/alumni_do_20240515_123456.png
📄 HTML: alumni_failures/alumni_do_20240515_123456.html

🤖 AI Analysis:
   The login button was not found on the page. Possible reasons:
   - The page may not have finished loading
   - The button might have a different text or appearance than expected
   - A modal dialog might be blocking access to the button
   
   Suggested fixes:
   - Add a wait step before trying to click: "Alumni Do wait for page to load completely"
   - Try using a more specific selector: "Alumni Do click button with id 'login-btn'"
   - Check if you need to dismiss a dialog first

Custom Keyword Registration

Extend AlumniRobotLibrary with your own Python functions:

def custom_validation(element_id, expected_value):
    # Your custom validation logic here
    return result

# In your Robot Framework test:
Register Custom Keyword    validate_custom_element    ${custom_validation}
Alumni Do    click on the settings icon
validate_custom_element    user-preference    enabled

Dynamic Test Data Types

The Generate Test Data keyword supports multiple data types:

  • user: Complete user profile with name, username, email, password
  • address: Physical address with street, city, state, zip
  • custom: Specify your own schema

System Requirements

  • Python 3.7 or newer
  • Robot Framework
  • Selenium or Playwright
  • Faker for test data generation
  • Appropriate LLM provider SDK based on your chosen AI provider

Contributing

We welcome contributions of all kinds! Here's how you can help:

  • Report Bugs: Open an issue describing the bug and steps to reproduce
  • Suggest Features: Have an idea? We'd love to hear it!
  • Submit PRs: Implement new features or fix existing issues
  • Improve Documentation: Help us make these docs even better

Please read our Contributing Guidelines before submitting PRs.

License

AlumniRobotLibrary is released under the MIT License.

Resources


Supercharge your Robot Framework tests with AI-powered automation!

Stars

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

alumnirobot-0.1.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

alumnirobot-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file alumnirobot-0.1.1.tar.gz.

File metadata

  • Download URL: alumnirobot-0.1.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for alumnirobot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 36a014cf4972e9242981509cc8eb2aa9bbc8c74e48737148bc0ebe88905a1754
MD5 1b0858423f21febdb72ef4f9e1990e0e
BLAKE2b-256 46d7932681b71e9c3e1a0d8047c8786d9fd54b5d60363b2f7c5580ccdb358a70

See more details on using hashes here.

File details

Details for the file alumnirobot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: alumnirobot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for alumnirobot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e6d118519fb1b9d32f132b2f24da752e6d7ad79af0159272af5902eb1411ee1
MD5 fc6a9db62b69d8dc1fd728032661d584
BLAKE2b-256 7fcdbc26f02b5c1fd5d864c1a9e0f975c031166326a25f4cbae915921bd7036c

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