Robot Framework test automation project for Shop e-commerce platform using Page Object Model (POM) pattern.
E-commerce-shop-automation/
├── resources/
│ ├── locators/ # All element locators organized by page
│ ├── pages/ # Page Object keywords
│ └── variables/ # Test data and configuration
├── tests/ # Test case files
└── results/ # Test execution results
- Python 3.8+
- Robot Framework
- SeleniumLibrary
- Chrome Browser
- VScode extension suggest: RobotCode
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtAll test data is centralized in resources/variables/test_data.robot:
- URLs
- Credentials
- Test data (product names, quantities, etc.)
- Timeouts
robot tests/# Windows
for /L %i in (1,1,3) do robot tests/test_case_01.robotrobot tests/test_case_01.robotrobot --include e2e tests/# Install pabot
pip install robotframework-pabot
# Run tests in parallel
pabot --processes 2 tests/robot --outputdir results --output output.xml --log log.html --report report.html tests/- Login to application
- Search product using autocomplete suggestions
- Configure product (color, quantity)
- Add to cart and proceed to checkout
- Verify price calculation
- Login to application
- Search product by pressing Enter
- Configure product (color, quantity)
- Add to cart and proceed to checkout
- Verify price calculation
- Locators: Separated by page/feature for easy maintenance
- Pages: Reusable keywords following Single Responsibility Principle
- Tests: High-level, readable test cases using business language
- Keywords: First Letter Uppercase And Rest Lowercase
- Variables:
${UPPER_CASE}for constants - Files: snake_case.robot
- Separation of Concerns: Locators, keywords, and tests are separated
- DRY Principle: Reusable keywords avoid duplication
- Readable Tests: Tests read like specifications
- Maintainability: Changes in UI only require locator updates
- Stable Locators: Prioritize data-testid attributes
The application uses Shadow DOM components. We handle this with:
Get shadow root elementkeyword in common_page.robot- Shadow selectors stored separately in locator files
- JavaScript execution for accessing shadow elements
Price calculation verification follows the formula:
Subtotal - Discount + Shipping = Total
The assertion includes detailed error messages showing actual values.
(PS. Discount price is a none value element then I try to ignore that for calculated correct price for now but next phase I will develop a best test script for sure thank you 😁)
After test execution, check the results/ directory for:
report.html- High-level test reportlog.html- Detailed execution log with screenshotsoutput.xml- Machine-readable results
Jiradech Khong-ngoen - QA Automation Engineer
This project is for show case of automated testing purposes only.