{"id":24229,"library":"percy-selenium","title":"Percy Selenium Python","description":"Python client for visual testing with Percy. Integrates with Selenium to capture screenshots and perform visual regression testing via Percy's cloud service. Current version 2.1.4, supports Python >=3.6, and is maintained by BrowserStack.","status":"active","version":"2.1.4","language":"python","source_language":"en","source_url":"https://github.com/percy/percy-selenium-python","tags":["visual-testing","selenium","percy","screenshot","regression"],"install":[{"cmd":"pip install percy-selenium","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for Selenium WebDriver integration.","package":"selenium","optional":false}],"imports":[{"note":"Old import path from pre-2.0 versions; now under percy_selenium package.","wrong":"from percy import Percy","symbol":"Percy","correct":"from percy_selenium import Percy"},{"note":"","wrong":null,"symbol":"percy_screenshot","correct":"from percy_selenium import percy_screenshot"}],"quickstart":{"code":"from selenium import webdriver\nfrom percy_selenium import Percy\n\n# Initialize Percy with driver\ndriver = webdriver.Chrome()\npercy = Percy(driver)\n\n# Navigate and snapshot\ndriver.get('https://example.com')\npercy.snapshot('Homepage')","lang":"python","description":"Captures a visual snapshot of the current page using the Percy SDK."},"warnings":[{"fix":"Update imports to `from percy_selenium import Percy`. Replace `desired_capabilities` with `options`.","message":"In v2.0.0, the import path changed from `percy` to `percy_selenium`. Old imports (`from percy import Percy`) will break. Additionally, the `Percy` class no longer supports `desired_capabilities`; use `webdriver.Options` instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set `PERCY_TOKEN` to your project's token from the Percy dashboard.","message":"The `PERCY_TOKEN` environment variable must be set for snapshot uploads. If missing, snapshots are silently skipped.","severity":"gotcha","affected_versions":"All"},{"fix":"Use `percy.snapshot('name', wait=True)` or call `percy.flush()` after all snapshots.","message":"The `snapshot()` method is asynchronous by default; snapshots are queued and processed after the test. To wait for upload, use `snapshot(name, wait=True)` or call `percy.flush()`.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install/upgrade: `pip install --upgrade percy-selenium` and use `from percy_selenium import Percy`.","cause":"Trying to import the old 'percy' module after upgrading to v2.0+.","error":"ModuleNotFoundError: No module named 'percy'"},{"fix":"Ensure the Percy CLI is running (`percy exec -- ...`) or set `PERCY_TOKEN` environment variable. If running locally, start Percy: `percy exec -- <your test command>`.","cause":"The Percy CLI or service is not started; or PERCY_TOKEN is missing.","error":"Exception: Percy is not running"},{"fix":"Upgrade to >=2.0 and use `percy.snapshot('name')`. Check the import is `from percy_selenium import Percy`.","cause":"Using an older version (<2.0) where the method name was different or the class structure was incompatible.","error":"AttributeError: 'Percy' object has no attribute 'snapshot'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}