Robot Framework library for Alumni (Alumnium)
Project description
AlumniRobotLibrary
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 alumnirobot.alumni_robot_library.AlumniRobotLibrary 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:
- Capture a screenshot and HTML of the page
- Analyze the failure using AI
- 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, passwordaddress: Physical address with street, city, state, zipcustom: 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
- AlumniRobotLibrary Documentation
- Alumnium Core Documentation
- Robot Framework User Guide
- Selenium Documentation
- Playwright Python Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alumnirobot-0.1.2.tar.gz.
File metadata
- Download URL: alumnirobot-0.1.2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a883e97844c33b5d81f874433b9060975d1cbdd45cf315fe6ea391af37a36577
|
|
| MD5 |
6e36a41d42dfde7ea3dae068182033b5
|
|
| BLAKE2b-256 |
2ff0c1c06403e37c2fbdef8c5807a7ed4f9a3d3838ec2b609bc1d6ce20e697b5
|
File details
Details for the file alumnirobot-0.1.2-py3-none-any.whl.
File metadata
- Download URL: alumnirobot-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ff28f6e5fb4948ab0628d745e508676cd825d76565f5a16939ecf6439366371
|
|
| MD5 |
95bca6bdc3384613d8dee1187492c00c
|
|
| BLAKE2b-256 |
d43a04c4998d105b0b8f47931dc68d32b3290cf74f3584649e600e2c2818b86b
|