Closed altoorodevelead closed 1 year ago
@altoorodevelead, thank you for creating this issue. We will troubleshoot it as soon as we can.
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!
Can you turn on logging and post results — https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/
Can you turn on logging and post results — https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/
Thank you for the reply. I will make sure to do so and update you.
Hello my friends :)
My ruby on rails CircleCI builds have begun to fail today, Aug 29th 2023
Maybe related?
Thanks
Your issue looks different. Starting from ChromeDriver 115 the download url has changed.
We turned on the logging, but not much extra was logged, an output was put in a file:
Selenium Manager binary found at: /Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager
Executing process: /Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --debug --output json
Pytest makes it incredibly difficult to actually see the logs.
Can you execute that last line manually in Terminal?
Here you go:
Traceback (most recent call last):
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 126, in run
output = json.loads(stdout)
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 90, in driver_location
output = self.run(args)
^^^^^^^^^^^^^^
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 129, in run
raise WebDriverException(f"Unsuccessful command executed: {command}") from err
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --output json
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in __init__
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
Execute this in the command line so we don't have to deal with PyTest getting in the way of the info:
/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --debug --output json
So super weird thing just happened, I opened a new terminal window, ran the command and got a "Permission denied" sort of message.
Then, ran the same command with sudo
prefixed, a JSON was outputted with a list of drivers:
{
"logs": [
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Checking chromedriver in PATH"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Running command: chromedriver --version"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Output: \"ChromeDriver 116.0.5845.96 (1a391816688002153ef791ffe60d9e899a71a037-refs/branch-heads/5845@{#1382})\""
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Running command: which chromedriver"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Output: \"/usr/local/bin/chromedriver\""
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Found chromedriver 116.0.5845.96 in PATH: /usr/local/bin/chromedriver"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "chrome detected at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Using shell command to find out chrome version"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Running command: /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --version"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Output: \"Google Chrome 116.0.5845.110 \""
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Detected browser: chrome 116.0.5845.110"
},
{
"level": "DEBUG",
"timestamp": 1693403830,
"message": "Required driver: chromedriver 116.0.5845.96"
},
{
"level": "INFO",
"timestamp": 1693403830,
"message": "Driver path: /usr/local/bin/chromedriver"
},
{
"level": "INFO",
"timestamp": 1693403830,
"message": "Browser path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
}
],
"result": {
"code": 0,
"message": "/usr/local/bin/chromedriver",
"driver_path": "/usr/local/bin/chromedriver",
"browser_path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
}
}
I assumed that this meant that the SeleniumManager
should work, so I executed this code once more:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com")
And it worked flawlessly, the browser opened and everything!
Thinking that the permission might reset if I restart the laptop, I did so, but no, running the same command without sudo this time it kept working, and the Python code now runs normally.
Update, the "permission issue" is back when calling:
/Users/julian/Desktop/Altooro/automation_tests/env/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager --browser chrome --debug --output json
Here is the output:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', src/metadata.rs:164:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1] 5581 abort --browser chrome --debug --output json
If we run with sudo it works, but only for a few hours.
Selenium can't fix permission issues on your computer. Elevate privileges of user or allow executing files in that directory to all users
We are going to put the driver in a specific location in 4.13 that might make it easier.
i am using the firefox 113 and i want to know weather the following code is correct or not.
self.options = Options()self.options.add_argument('--ignore-certificate-errors') self.options.add_argument('--ignore-ssl-errors') self.profile = webdriver.FirefoxProfile() if os.environ.get('IS_SERVER') == "1": self.profile.set_preference("browser.cache.disk.enable", False) self.profile.set_preference("browser.cache.memory.enable", False) self.profile.set_preference("browser.cache.offline.enable", False) self.profile.set_preference("network.http.use-cache", False)
self.options.headless = True
def my_driver(self): try: self.helper.check_connection()
options = FirefoxOptions()
self.profile.update_preferences()
firefox_driver = webdriver.Firefox(options=options)
webdriver_wait = WebDriverWait(firefox_driver, 25, poll_frequency=1)
firefox_driver.set_page_load_timeout(200)
return True, firefox_driver, webdriver_wait
except:
traceback.print_exc()
return False
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.
What happened?
Hello, I'm trying to run Selenium 4.11 and to use the Selenium Manager to auto download the browser/driver. This is the code:
But i'm getting the usual:
How can we reproduce the issue?
Relevant log output
Operating System
macOS Monterey
Selenium version
Python 4.11.2
What are the browser(s) and version(s) where you see this issue?
Chrome 116
What are the browser driver(s) and version(s) where you see this issue?
Chrome 116
Are you using Selenium Grid?
No