I'm trying to run multiple drivers through multi-threading using Selenium. However I'm experiencing a weird problem, when I have more than 5 drivers open for example, the code seems to execute in the background in the sense that it navigates over to the webpages and clicks elements etc. But the program does not go through any print statements nor does it close at the end until I click on the chrome window and it is "viewable" on the screen. I also noticed if I have any other application (say Sublime Text) over the chrome instance than it's the same problem.
I was able to work this before even when I have 50 different instances running at the same time but not sure what happened that it's doing this. Any help would be appreciated and if I can provide any other details.
The following is what I am using in the options to create my driver:
PATH = self.webDriverPath
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-logging"])
options.add_experimental_option("detach", True)
options.add_argument("--start-maximized")
self.driver = webdriver.Chrome(executable_path = PATH, options = options)
I'm also getting the following message:
DevTools listening on ws://127.0.0.1:62963/devtools/browser/11b5a873-fe5a-4831-878f-a9c0225c062d [504:2752:1119/191918.546:ERROR:device_event_log_impl.cc(211)] [19:19:18.546] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
NOTE:
I hovered my mouse over the chrome icon that pops up and I can see the Title changing when going to a webpage for example. But the preview stays blank. Before I was able to see the preview of what the page looks like without actually opening up the window.