E-commerce Checkout
This tutorial shows you how to create a test for an e-commerce checkout process.
Overview
This tutorial covers:
Recording a checkout flow
Handling form inputs
Verifying order confirmation
Testing with different payment methods
Prerequisites
TrueAssert account
Browser plugin installed
E-commerce website to test
Test products available
Step 1: Plan Your Test
Test Flow:
Navigate to product page
Add product to cart
Go to cart
Proceed to checkout
Fill shipping information
Select payment method
Complete order
Verify order confirmation
Step 2: Record the Test
Open browser plugin
Navigate to e-commerce website
Click "Record"
Perform checkout flow:
Navigate to product page
Click "Add to Cart"
Click cart icon/badge
Click "Checkout" or "Proceed to Checkout"
Fill shipping form:
Name
Address
City, State, ZIP
Phone
Select shipping method
Fill payment information:
Card number
Expiry date
CVV
Click "Place Order"
Wait for order confirmation
Click "Stop and Save"
Enter test name:
E-commerce Checkout TestClick "Save"
Step 3: Review Generated Steps
Go to test detail page
Review all steps:
Verify selectors for form fields
Check values are correct
Ensure step order is logical
Edit any incorrect steps:
Fix selectors if needed
Update values if needed
Add waits if timing issues
Step 4: Optimize the Test
Add Waits
Add waits before critical interactions:
Wait for cart to update after adding item
Wait for checkout page to load
Wait for payment form to appear
Use Test Data
Consider using test data:
Use test credit card numbers
Use test addresses
Use test email addresses
Handle Dynamic Elements
Cart item counts may be dynamic
Order numbers are unique
Use stable selectors for confirmation
Step 5: Execute Test
Click "Run Test"
Monitor execution:
Watch for form filling
Check for navigation
Verify order completion
Wait for completion
Step 6: Verify Results
Check execution status:
Should be SUCCESS if all steps passed
Review any FAIL steps
Review step results:
Verify all form fields were filled
Check navigation steps succeeded
Confirm order was placed
View screenshots:
Check form filling screenshots
Verify order confirmation screenshot
Review any failure points
Advanced Scenarios
Multiple Products
Test checkout with multiple products:
Add multiple products to cart
Verify cart shows all items
Proceed through checkout
Verify order includes all items
Different Payment Methods
Test different payment methods:
Create separate tests for each method
Or use test data to switch methods
Verify each method works
Shipping Options
Test different shipping options:
Select different shipping methods
Verify shipping costs update
Complete checkout with each option
Troubleshooting
Form Fields Not Filling
Problem: FILL steps fail
Solution:
Check selectors for form fields
Verify fields are visible and enabled
Add waits before filling
Check for iframes (payment forms)
Cart Not Updating
Problem: Cart count doesn't update
Solution:
Add WAIT step after adding to cart
Wait for cart badge to update
Use stable selector for cart count
Payment Form Issues
Problem: Payment form not accessible
Solution:
Check if payment form is in iframe
Verify iframe is loaded
Use appropriate selectors for iframe content
Best Practices
Use Test Data: Always use test payment methods
Handle Timing: Add waits for dynamic content
Verify Results: Always verify order confirmation
Test Edge Cases: Test with different scenarios
Related Topics
Browser Plugin Recording - Recording guide
Running Tests - Execute tests
Debugging Failed Tests - Fix issues
Last updated