Quantcast
Viewing all articles
Browse latest Browse all 5970

Prevent Selenium from taking the focus to the opened window

I have 40 Python unit tests and each of them open a Selenium driver as they are separate files and cannot share the same driver.

from selenium import webdriverwebdriver.Firefox()

The above commands will take the focus to the new opened window. For example, if I am on my editor and typing something, in the middle of my work, suddenly a selenium browser is opening and Linux switch to that window. I am not sure if Windows or Mac have a similar problem or not.

This means that every time I run a unit, I cannot use my computer as it keeps switching away from the application that I am currently using.

How can I tell Selenium not to switch to the opened window?


Viewing all articles
Browse latest Browse all 5970

Trending Articles