This project uses Selenium and Percy to capture visual snapshots of multiple URLs in batches using Python. By leveraging parallel threading, it efficiently processes large lists of URLs, uploading snapshots to Percy for visual testing.
- Python: Version 3.7 or higher
- Percy CLI: Required for snapshot uploading (see installation steps below)
- ChromeDriver: Ensure it matches your installed Chrome version
- Percy Account: Sign up for a Percy account to get your project token
It's recommended to create a virtual environment to manage dependencies isolated from your system Python.
python3 -m venv venv
source venv/bin/activate
The Percy CLI is needed to capture and upload snapshots. Install it via npm:
npm install
With the virtual environment activated, install the required Python packages:
pip3 install -r requirements.txt
This file contains all the URLs you need to capture using Percy.
Export the Percy Token located in your project settings of Percy and then run the python command to initiate the execution.
export PERCY_TOKEN=your-percy-token
npx percy exec -- python3 batchProcess.py