This framework combines Selenium WebDriver with AI capabilities for robust and intelligent web testing, using natural language descriptions to interact with web elements.
- AI-powered element location using Google's Gemini API
- Natural language interactions with web elements
- No XPath or CSS selectors needed - AI finds elements automatically
- Rich set of AI-powered actions (click, type, hover, drag & drop, etc.)
- Configurable test environments
- Screenshot capture on test failure
- Support for multiple browsers
- Clone the repository
- Install dependencies:
pip install -r requirements.txt- Configure your environment:
- Update
config.jsonwith your Gemini API key - Configure browser settings in
browsers.json
- Update
├── framework/ # Core framework components
│ ├── actions.py # AI-powered UI actions
│ ├── ai_finder.py # AI-powered element locator
│ └── utils.py # Utility functions
├── tests/ # Test cases
│ ├── conftest.py # pytest configurations
│ └── test_*.py # Test modules
├── config.json # Main configuration
└── requirements.txt # Python dependencies
Example test using AI-powered actions:
def test_login(actions):
actions.ai_clear_and_type("the username field", "standard_user")
actions.ai_clear_and_type("the password field", "secret_sauce")
actions.ai_click("the login button")
assert actions.ai_is_displayed("the inventory page"), "Login failed"Available AI Actions:
ai_click(description)- Click an elementai_clear_and_type(description, text)- Type into a fieldai_hover(description)- Hover over an elementai_double_click(description)- Double click an elementai_right_click(description)- Right click an elementai_drag_and_drop(source_desc, target_desc)- Drag and drop elementsai_scroll_to(description)- Scroll to an elementai_wait_until_visible(description)- Wait for element visibilityai_wait_until_clickable(description)- Wait for element to be clickableai_select_option(dropdown_desc, option_desc)- Select from dropdownai_get_text(description)- Get element textai_is_displayed(description)- Check if element is visibleai_is_enabled(description)- Check if element is enabled- And more...
Run all tests:
pytestRun specific test:
pytest tests/test_login.py{
"gemini": {
"api_key": "YOUR_API_KEY",
"model_name": "gemini-2.0-flash-001"
},
"webdriver": {
"browser": "chrome",
"headless": false,
"implicit_wait": 10
}
}- Natural Language Testing: Write tests using human-readable descriptions
- Maintenance-Free: No need to update selectors when UI changes
- Self-Healing: AI adapts to find elements even after UI updates
- Readable Tests: Tests are clear and understandable
- Quick Test Development: No time spent crafting complex selectors
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.