When adding multiple products to cart using the "Continue Shopping" button, only the last product is retained. Previous products are lost.
HIGH - Critical cart functionality broken
- Site: https://www.automationexercise.com
- Browser: Chrome 143.0.7499.192
- OS: Windows 11
- Test Framework: Selenium 4.x + Python 3.12 + Pytest
- Navigate to Products page
- Add first product to cart (e.g., "Blue Top")
- Click "Continue Shopping" button in modal
- Wait 2 seconds for modal to close
- Add second product to cart (e.g., "Men Tshirt")
- Click "View Cart" button in modal
- Observe cart contents
Cart should contain both products:
- Blue Top (quantity: 1)
- Men Tshirt (quantity: 1)
- Total items: 2
Cart contains only the last product:
- Men Tshirt (quantity: 1)
- Total items: 1 ❌
INFO Attempting to add products: ['Blue Top', 'Men Tshirt']
INFO Clicked add to cart button for product 0
INFO Product 0 added to cart successfully
INFO Clicking Continue Shopping
INFO Modal closed successfully
INFO Ready for next action
INFO Clicked add to cart button for product 1
INFO Product 1 added to cart successfully
INFO Clicking View Cart from modal
INFO Navigating to cart page
INFO Cart count after adding 2 products: 1 ← SHOULD BE 2 ❌
reports/screenshots/test_remove_product_from_cart_[timestamp].png
Backend session/cookie management bug.
The site's cart implementation appears to:
- Store cart in session/cookies
- When "Continue Shopping" is clicked, session is NOT properly maintained
- Second add-to-cart AJAX call overwrites entire cart instead of appending to it
- ✅ Added 1.5s wait after add-to-cart
- ✅ Added 2s wait after Continue Shopping
- ✅ Used JavaScript click
- ✅ Used hover + normal click
- ✅ Waited for modal to appear
- ✅ Waited for modal to disappear
- ❌ None resolve the issue - this is a backend bug
- Users: Cannot add multiple products from product list page
- Business: Potential revenue loss (users must navigate to detail pages)
- Testing: Blocks automated cart operations tests
Add products from individual product detail pages, not from list page.
# ❌ DOESN'T WORK:
products.add_product_to_cart(0)
products.click_continue_shopping()
products.add_product_to_cart(1) # First product lost
# ✅ WORKS:
products.click_view_product(0)
detail = ProductDetailPage(driver)
detail.add_to_cart()
# Navigate to cart, then back to products, repeat- Reported: 2026-01-07
- Reporter: QA Automation Engineer
- Status: OPEN
- Priority: HIGH
- Reproducibility: 100% (reproduced across 15+ test runs)
tests/test_cart_operations.py::TestCartOperations::test_remove_product_from_carttests/test_product_features.py::TestProductFeatures::test_add_products_to_cart
Both tests marked with @pytest.mark.xfail until bug is resolved.
- Report to automationexercise.com development team
- Consider migrating to more stable test site (e.g., SauceDemo)
- Implement workaround tests using product detail page approach