Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Unable to obtain driver after update to Selenium 4.11.2 on MacOS #12543

Closed
MarcGruener opened this issue Aug 14, 2023 · 6 comments

Comments

@MarcGruener
Copy link

What happened?

I was using Selenium 4.10.0 for a Python 3.11.4 project on MacOS Ventura 13.4.1 successfully.
However, after updating Selenium to 4.11.2 with the Safari Driver, I would always get the following error:

selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for safari using Selenium Manager.

When debugging with safaridriver --version, I would always get:

Included with Safari 16.5.2 (18615.2.9.11.10)

I also manually checked $PATH and it was included so it should be working.
After downgrading to Selenium 4.10.0 again, everything works perfectly again.

How can we reproduce the issue?

from selenium import webdriver

browser = webdriver.Safari()
browser.get('http://selenium.dev/')

Relevant log output

selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for safari using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Operating System

macOS Ventura 13.4.1

Selenium version

Python 4.11.2

What are the browser(s) and version(s) where you see this issue?

Safari 16.5.2

What are the browser driver(s) and version(s) where you see this issue?

Safari 16.5.2 (18615.2.9.11.10)

Are you using Selenium Grid?

No response

@github-actions
Copy link

@MarcGruener, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Aug 14, 2023

Looks like a ChatGPT answer 馃槀

@titusfortner
Copy link
Member

Can you turn on logging and provide the output so we can see what Selenium Manager is doing?
https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/

@MarcGruener
Copy link
Author

I tried but I can't quite figure out how to activate the logging/its not working as expected:

  1. Created conda environment
  2. Activated conda environment (Python 3.11.4)
  3. Installed selenium with conda install -c conda-forge selenium
  4. Created test_selenium.py
# test_selenium.py
import logging

logging.basicConfig(filename='selenium.log', encoding='utf-8', level=logging.DEBUG)
logger = logging.getLogger('selenium')

logging.info('<--- Started --->')

from selenium import webdriver

browser = webdriver.Safari()
browser.get('http://selenium.dev/')

logging.info('<--- Finished --->')

--> Getting the selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for safari using Selenium Manager. error

  1. Run python test_selenium.py and open selenium.log:
INFO:root:<--- Started --->

If I follow the same steps as above but use conda install -c conda-forge selenium=4.10.0 during step 3. instead, everything works as expected and this is what selenium.log looks like:

INFO:root:<--- Started --->
DEBUG:selenium.webdriver.common.service:Started executable: `/usr/bin/safaridriver` in a child process with pid: 33094
DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:51207/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "safari", "platformName": "mac", "pageLoadStrategy": "normal"}}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): localhost:51207
DEBUG:urllib3.connectionpool:http://localhost:51207 "POST /session HTTP/1.1" 200 0
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=200 | data={"value":{"sessionId":"283B1A64-9B8F-4AE4-A9D0-F584A6A55218","capabilities":{"safari:platformVersion":"13.4.1","safari:automaticInspection":false,"webkit:WebRTC":{"DisableICECandidateFiltering":false,"DisableInsecureMediaCapture":false},"browserVersion":"16.5.2","strictFileInteractability":false,"browserName":"Safari","safari:useSimulator":false,"safari:platformBuildVersion":"22F82","setWindowRect":true,"acceptInsecureCerts":false,"safari:automaticProfiling":false,"pageLoadStrategy":"normal","platformName":"macOS","safari:diagnose":false}}} | headers=HTTPHeaderDict({'Server': 'safaridriver [18615.2.9.11.10]', 'Content-Type': 'application/json; charset=utf-8', 'Date': 'Mon, 14 Aug 2023 13:01:07 GMT', 'Accept-Ranges': 'bytes', 'Content-Length': '546', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:51207/session/283B1A64-9B8F-4AE4-A9D0-F584A6A55218/url {"url": "http://selenium.dev/"}
DEBUG:urllib3.connectionpool:http://localhost:51207 "POST /session/283B1A64-9B8F-4AE4-A9D0-F584A6A55218/url HTTP/1.1" 200 0
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Server': 'safaridriver [18615.2.9.11.10]', 'Content-Type': 'application/json; charset=utf-8', 'Date': 'Mon, 14 Aug 2023 13:01:08 GMT', 'Accept-Ranges': 'bytes', 'Content-Length': '14', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
INFO:root:<--- Finished --->

@titusfortner
Copy link
Member

Oh, Conda. That's different.

Conda does not currently support Selenium Manager, you'll need to continue to manage your own drivers until we can determine a work-around. #11234

Copy link

github-actions bot commented Dec 8, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants