DEV Community

ZcodeZ777
ZcodeZ777

Posted on

'selenium.common.exceptions.SessionNotCreatedException' Error using SeleniumBase

I am currently using SeleniumBase for web automation in Python, however, occasionally I am receiving a 'session not created' error:

test16.py - selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot connect to chrome at 12... 
Enter fullscreen mode Exit fullscreen mode

For example, in this code block:

from seleniumbase import BaseCase BaseCase.main(__name__, __file__, "--uc") class MultipleDriversTest(BaseCase): def test_multiple_drivers(self): url1 = "https://invideo.io/perf/ga-ai-video-generator-web/?utm_source=google&utm_medium=cpc&utm_campaign=Top16_Search_Brand_Exact_EN&adset_name=InVideo&keyword=invideo&network=g&device=c&utm_term=invideo&utm_content=InVideo&matchtype=e&placement=g&campaign_id=18035330768&adset_id=140632017072&ad_id=616240030555&gad_source=1&gclid=Cj0KCQiAvvO7BhC-ARIsAGFyToWFf0L_8iqkB32qg9prKxVApsklZ8HA69LW2O0Z6XC1nbXXz9sCTTEaAinZEALw_wcB" driver1 = self.driver self.activate_cdp_mode(url1) url2 = "https://temp-mail.org/en" driver2 = self.get_new_driver(undetectable=True) # <- ERR self.activate_cdp_mode(url2) self.sleep(2) print(driver1.get_current_url()) self.sleep(2) print(driver2.get_current_url()) 
Enter fullscreen mode Exit fullscreen mode

I constantly receive the error when the program tries to get the second driver.

Does anybody know what the cause of this may be?

Top comments (0)