0

I've built a tool to automate visual regression as part of an E2E test suite and while it works fine under most situations I have encountered a problem trying to measure visual regression with auto playing HTML5 videos.

As a video is a moving target for the screenshots and the Browserstack session is always reliant on Browserstack's server speed there is rarely going to be a situation where the screenshots taken after the screen has loaded will be a close enough to serve as a reliable source for a visual regression test. In a build process most of the time there will be a 90% visual difference.

One solution would be to point my visual regression tool at a ?video=off or a ?test=true url but I would also like to explore executing javascript on the active browser session in BrowserStack to use the HTML5 video to stop and set the frame of the video to a fixed point to act as a more reliable source of visual regression.

Is there anything similar to the execute function of camme's version of webdriverjs inside the browserstack-webdriver as this feels like there could be a few scenarios where specific JS might need to execute to make the most out of visual regression testing.

Artjom B.
  • 58,311
  • 24
  • 111
  • 196
Palgie
  • 195
  • 2
  • 9

1 Answers1

0

I have found a solution to this by going through the source for the node module so for anyone looking at the same issue you can execute using the below:

driver.executeScript('alert("foo")');

For anyone with a similar issue with video and visual regression I have decided to use a query string in the URL as a more reliable way to effect those moving parts of a website as executing JS in the executeScript function not only felt dirty but also introduces it's own cross browser specific issues which increases complexity in larger teams.

Palgie
  • 195
  • 2
  • 9