Skip to main content
AI agents are now live in Website Scanner! Enter your URL and fix website issues 3x faster with AI. Explore now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Integrate your Selenium JavaScript tests with Percy

A guide to integrating your Selenium JavaScript automated tests with BrowserStack Percy. Catch visual differences in your web application on time.

Percy integrates with your tests using both Percy and BrowserStack SDK. To establish this integration, choose the appropriate SDK and refer to the following section accordingly:

You can integrate your tests using the BrowserStack SDK and manage browsers through Percy. Percy supports the latest versions of modern browsers, including Chrome, Firefox, Edge, and Safari.

Create Project

Create a Percy Web project using the Percy dashboard. For more information, see Create a project.

Update your BrowserStack config file

  1. In the browserstack.yml file, set percy: true.

  2. Set a projectName.
    Use the same projectName specified when creating the Percy Web Project.

  3. Set browserstackAutomation: true if it is currently set to false.

  4. Set percyCaptureMode: manual.

Currently, we do not support percyCaptureMode: auto on Percy web project and using BrowserStack SDK.

Below sample browserstack.yml file shows how to set the percy, the projectName, percyCaptureMode and the browserstackAutomation parameters.

Copy icon Copy

Update your test script

To manually capture snapshot alongside the auto mode, implement the following steps in your test script:

  1. Import the BrowserStack Percy SDK in your test script.
  2. Add the percy.snapshot(driver, name) method at required points in your test script to get the snapshot you want.

Here’s an example:

Javascript
Copy icon Copy

Run your test script

Terminal
Copy icon Copy

Your script is ready to execute visual tests, and Percy is prepared to receive the build. After the tests runs, the snapshots are added to the same Percy project.

A build with the same project name and platform configuration mentioned in the BrowserStack config file appears on the Automate dashboard.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle