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
The Percy CLI is needed to capture and upload snapshots. Install it via npm:
npm install
pip3 install -r requirements.txt
This file contains all the URLs you need to capture using Percy.
This will point the selenium test to your chromedrive to successfully launch the Chrome Browser. You can also update the variable NUM_THREADS
if you want to increase the number of parallel threads.
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