I'm using the Java Selenium and Chrome webdriver on Windows 10. I like to have a GUI up for debugging purposes, but my code keeps bringing the browser into focus. Specifically, lines like
will bring the automated Chrome browser into focus, taking me away from checking my e-mail etc. This is true regardless of whether I'm currently looking on Chrome or another browser.
How can I get Selenium to "silently" focus on a new tab (or window etc) so I can do something while my code runs? This is sort of like the issue reported here: How can I bring Chrome browser to focus when running a Selenium test using ChromeDriver on Mac?, except I want to create the unfocused behavior that that user is trying to change.