Your task is to build a basic browser automation script using Playwright in Python to interact with a public web app: https://www.saucedemo.com.
This should demonstrate your ability to:
- Navigate and interact with UI elements
- Automate form submissions
- Handle validation errors
- Extract and export structured data
We expect you to spend a few hours on this assignment. You're free to spend more time if youβd like. You can start whenever you're ready and do not need to start this today. You can use any tool(s) or AI you want to complete this assignment.
- Attempt login with both valid and invalid inputs
- Capture and log any form validation errors
- After successful login, extract product names and prices
- Simulate a checkout attempt with missing data and log validation results
- Save product data to a
.csvfile - Log all major steps and actions taken
- Extra Credit - Redo the same assignment without Playwright β use PyAutoGUI to control the browser purely by screen position/image matching.
Requirements:
- Full flow: invalid login, valid login, extract product names/prices, checkout with missing data.
- Locate UI via screenshots (image templates) + optional OCR for text capture.
- Include waits/retries and error handling.
- Save CSV for products, log each major step, and take screenshots.
- Script should run start-to-finish with no manual clicks.
- Use at least Python + Playwright libraries
- Use the built-in
loggingmodule for logging - Save logs to a
.logfile - Save product data to a
.csvfile - Include a
requirements.txtfile with all dependencies - Script must be runnable via CLI using:
python main.py - Optionally use pydantic and prefect.
- Include logs at each step, including validation errors
- Capture screenshots when validation errors are triggered (optional extra credit)
- Ensure the
.csvdata file is generated and contains accurate, expected content
- Fork this repository
- Complete your implementation and commit your changes
- Send us your name and a link to your GitHub repo once you're done to careers@lamarhealth.com
main.pyβ your main automation scriptproducts.csvβ product data outputautomation.logβ log of all steps and errorsautomation_screenshots/β (optional) directory of screenshotsREADME.mdβ summary of the project + answers to the reflection questions below- Link to a video showing the full automation working (in non headless mode) and also how this appears in perfect UI.
- What steps did you prioritize first? Why?
- How long did you actually spend on the project?
- How did you know your automation was working?
- What would you improve with more time?