File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4040from selenium .common .exceptions import JavascriptException
4141from selenium .common .exceptions import NoSuchCookieException
4242from selenium .common .exceptions import NoSuchElementException
43+ from selenium .common .exceptions import SessionNotCreatedException
4344from selenium .common .exceptions import WebDriverException
4445from selenium .webdriver .common .bidi .browser import Browser
4546from selenium .webdriver .common .bidi .network import Network
@@ -343,9 +344,13 @@ def start_session(self, capabilities: dict) -> None:
343344 """
344345
345346 caps = _create_caps (capabilities )
346- response = self .execute (Command .NEW_SESSION , caps )["value" ]
347- self .session_id = response .get ("sessionId" )
348- self .caps = response .get ("capabilities" )
347+ try :
348+ response = self .execute (Command .NEW_SESSION , caps )["value" ]
349+ self .session_id = response .get ("sessionId" )
350+ self .caps = response .get ("capabilities" )
351+ except SessionNotCreatedException :
352+ self .service .stop ()
353+ raise
349354
350355 def _wrap_value (self , value ):
351356 if isinstance (value , dict ):
You can’t perform that action at this time.
0 commit comments