I am looking for a way to run selenium tests using a chrome driver in the background. With background, I mean both in, and not in the foreground, a focal window. I really can do this, but as soon as actions, such as opening a new tab or switching between windows (so basically changing window handles), happen in the chrome driver, the browser window is brought to the fore.
So my question is: how can I prevent this by not running a test headless?
Any suggestions are welcome, open for discussion.
EDIT
As a somewhat workaround, I came up with the following.
Using the Windows 10 virtual desktops feature, I run a test and thus the Chrome browser window on a separate desktop. Then I will return to the main virtual desktop to continue with other tasks. This prevents the Chrome browser window from being forced to the foreground.
Note that this still causes the flashing chrome icon on the taskbar to appear when any of the above actions appears.
Look for a more durable solution, so any suggestions will still be accepted.
To hope to open up new perspectives and discussion points, and ultimately this decision, I will talk about more details about what my code does.
5 -webdrivers, webdrivers 6 (WindowHandles).
, . webdriver webdriver WindowHandle. .
, , , .
, -webdriver (WindowHandle), , , . , , - . , , .
EDIT 2
:
selenium, (WindowHandles) SetWindoPos. , . , , . - S. Van den Wyngaert
, , ( win10). , . , , .
, , ( chrome ).
.
, , , , . , :
, :
, :
, , , , .