Cant send commands to selenium webdriver in detached session because link http://localhost:port died.
But if i put breakpoint 1 link stay alive
import multiprocessing
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def create_driver_pool(q):
options = Options()
driver = webdriver.Chrome(options=options)
pass #breakpoint 1
return driver.command_executor._url
windows_pool = multiprocessing.Pool(processes=1)
result = windows_pool.map(create_driver_pool, [1])
print(result)
pass # breakpoint 2 for testing link
why is this happening and what can i do about it?
After some research i finally found the reason for this behavor. Thanks https://bentyeh.github.io/blog/20190527_Python-multiprocessing.html and some googling about signals. This is not signals at all. I found this code in selenium.common.service
This is handler for garbage collector function, that killing subprocess via SIGTERM
But if you in the debug mode with breakpoint, garbage collector wont collect this object, and del wont start.