This project demonstrates automated UI testing of the Sauce Demo website using Robot Framework with Selenium WebDriver and Allure reporting.
selenium-robot-framework-ui-tests-python/
├── Resources/
│ ├── common.robot # Common settings and keywords
│ ├── login_page.robot # Login page specific keywords
│ └── allure_config.robot # Allure reporting configuration
├── Tests/
│ └── login_test.robot # Login test cases
└── Results/
├── Screenshots/ # Test execution screenshots
├── allure-results/ # Raw Allure results
└── allure-report/ # Generated Allure HTML report
- Python 3.x
- pip (Python package installer)
- Chrome/Firefox browser
- ChromeDriver/GeckoDriver
- Java 8 or higher (for Allure report generation)
- Allure command-line tools
brew install allure
scoop install allure
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
robot -d Results Tests/login_test.robot
robot --listener allure_robotframework -d Results Tests/login_test.robot
robot --listener allure_robotframework --variable BROWSER:headlesschrome -d Results Tests/login_test.robot
After test execution, generate and view the Allure report:
# Generate the report
allure generate Results/allure-results -o Results/allure-report --clean
# View the report
allure open Results/allure-report
The test suite includes login tests for all available user types:
- Standard User (
standard_user
) - Locked Out User (
locked_out_user
) - Problem User (
problem_user
) - Performance Glitch User (
performance_glitch_user
) - Error User (
error_user
) - Visual User (
visual_user
)
All users share the same password: secret_sauce
- Page Object Model (POM) implementation
- Gherkin-style test cases (Given/When/Then)
- Allure reporting integration
- Automatic screenshot capture
- Support for both headed and headless browser testing
- Cross-browser testing support
- Detailed test execution reports
The Allure report provides:
- Test execution overview
- Test case details with steps
- Screenshots for each test
- Test execution timeline
- Test suite statistics
- Environment information
- Test categorization by tags
- Failure analysis
-
WebDriver Issues:
- Ensure browser and WebDriver versions match
- Check if WebDriver is in system PATH
- Try using
webdriver-manager
for automatic driver management
-
Allure Report Issues:
- Verify Java installation (
java -version
) - Check Allure installation (
allure --version
) - Ensure Results directories exist and are writable
- Verify Java installation (
-
Test Failures:
- Check application availability
- Verify test user credentials
- Review screenshots in Results/Screenshots
- Check Allure report for detailed error information
- 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.