Using selenium and python, I have several tests that need to be run in parallel. To avoid using the same browser, I added the option to use a specific profile and user data (see below). The problem is that I can not run them at the same time, one test must wait for the completion of another. Otherwise, I get the following error from chromedriver:
Starting ChromeDriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233) on port 9515
Only local connections are allowed.
[0.000][SEVERE]: bind() returned an error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (0x2740)
Selenium setup:
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--user-data-dir=C:/ChromeProfile')
chrome_options.add_argument("--profile-directory=Profile1")
chrome_options.add_argument('--start-maximized')
chrome_options.add_argument('--incognito')
self.driver = webdriver.Chrome(executable_path='C:/Chrome/chromedriver.exe',chrome_options=chrome_options)
source
share