2

Protractor / webdriver seems to be bringing the window to foreground every time you take a screenshot programmatically from a test spec:

browser.takeScreenshot().then(function (png) {
   // code that stores screenshot to hard-drive
});

Is there any way how to control this behaviour? I would ideally like to keep it in the background when running tests.

Michal Lison
  • 489
  • 4
  • 7

1 Answers1

1

There is no workaround selenium side.

The option is a headless solution so e2e doesn't interrupt you while running the tests, see this answer: https://stackoverflow.com/a/23461432/511069

I use ubuntu-headless solution for this, you can still see the browser through a VNC connection but focus doesn't affect you ever.

Community
  • 1
  • 1
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110