[BUG] SessionNotCreatedException on Mobile Browser Creation
jungx098 opened this issue · 5 comments
Before submitting a bug report...
- This bug wasn't already reported.
(I have checked every bug report on GitHub)
Title
- The title is no longer "[BUG] Title" and I edited it with the right error name.
Describe the bug
SessionNotCreatedException occurs when the mobile browser instance is created on my Mac. Looking at the issue list, this error has been observed periodically on various platforms, but all the issues in the list are currently closed.
This is probably because the same session data is shared between the desktop and mobile webdrivers, the desktop webdriver is not destroyed, and the mobile webdriver is denied access to the session data.
Destroying the webdriver instance seems to be necessary.
Copy and paste your error
2024-06-18 19:13:18,534 [ERROR] SessionNotCreatedException: Message: session not created: cannot connect to chrome at 127.0.0.1:63462
from chrome not reachable
Screenshots
NA
Value of dashboard variable
NA
This issue is stale because it has been open for 14 days with no activity.
This was happening to me, I added a sleep between closing the desktop browser and opening the mobile which appears to have fixed the issue in #137. Give it a shot and let me know if it fixes it for you.
This was happening to me, I added a sleep between closing the desktop browser and opening the mobile which appears to have fixed the issue in #137. Give it a shot and let me know if it fixes it for you.
I actually didn't have any luck with this. Quit was working for me to start the mobile searches but would leave hanging processes and close would break it. Sleeping didn't help. Finally got the best of both worlds with this in browser.py. The previous fix of .close and .quit together did not work but for some reason ensuring the process is active before attempting to close anything and then dereferencing it works. Please let me know if this works for you all. @klept0
def closeBrowser(self) -> None:
"""Perform actions to close the browser cleanly."""
# Close the web browser
if self.webdriver:
with contextlib.suppress(Exception):
self.webdriver.close()
with contextlib.suppress(Exception):
self.webdriver.quit()
self.webdriver = None