python - Run Multiple Instances of ChromeDriver -
using selenium , python have several tests need run in parallel. avoid using same browser added parameter of using specific profile directory , user data (see below). problem cannot run them simultaneously, 1 test needs wait other finish. otherwise following error chromedriver:
starting chromedriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233) on port 9515 local connections allowed. [0.000][severe]: bind() returned error: 1 usage of each socket address (protocol/network address/port) permitted. (0x2740)
selenium setup:
chrome_options = webdriver.chromeoptions() chrome_options.add_argument('--user-data-dir=c:/chromeprofile') chrome_options.add_argument("--profile-directory=profile1")#profile2,profile3, etc 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)
try this
chrome_options = webdriver.chromeoptions() chrome_options.add_argument('--user-data-dir=c:/chromeprofile/profile1')#profile2,profile3, etc.
do not use
chrome_options.add_argument("--profile-directory=profile1")
the --profile-directory
multiple profiles in same browser
Comments
Post a Comment