-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: msedge webdriver launches chrome on Ubuntu linux when specify the webdriver path #12518
Comments
@fz0000, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
What happens when you run on the terminal |
Sorry, I meant, what happens when you run |
If you turn on logging and run it, we can get more insight — https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/ If you have a driver on PATH and don't specify anything, Selenium will first locate the Edge Browser then will take the driver it finds on PATH and tell it to use the browser it found. If you specify the browser location, Selenium will use the provided browser and take the driver it finds on PATH. The behavior should be exactly the same if the location provided matches the location Selenium finds by default. |
I wonder if it is actually a ChromeDriver renamed to MSEdgeDriver by accident. I do not see how else a MSEdgeDriver binary can open Chrome. |
Yes, this is the error you would get for a chromedriver trying to open Edge, but that doesn't track with how the issue has been reported, so I'm interested in seeing logs. |
I have checked again and the webdriver is correct. The webdriver log with default settings is: Selenium Manager binary found at: /my/venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /my/venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser MicrosoftEdge --debug --output json
Checking msedgedriver in PATH
Running command: msedgedriver --version
Output: ""
msedgedriver not found in PATH
edge detected at /opt/microsoft/msedge/microsoft-edge
Using shell command to find out edge version
Running command: /opt/microsoft/msedge/microsoft-edge --version
Output: "Microsoft Edge 115.0.1901.200 "
Detected browser: edge 115.0.1901.200
Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_115_LINUX
Required driver: msedgedriver 115.0.1901.200
Driver URL: https://msedgedriver.azureedge.net/115.0.1901.200/edgedriver_linux64.zip
Driver path: /home/user/.cache/selenium/msedgedriver/linux64/115.0.1901.200/msedgedriver
Browser path: /opt/microsoft/msedge/microsoft-edge
Using driver at: /home/user/.cache/selenium/msedgedriver/linux64/115.0.1901.200/msedgedriver
Started executable: `/home/user/.cache/selenium/msedgedriver/linux64/115.0.1901.200/msedgedriver` in a child process with pid: 1664229
Starting Microsoft Edge WebDriver 115.0.1901.200 (64b0164e9f6a43a530acd52f6525ddd6fe990817) on port 54831
To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver
Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.
Microsoft Edge WebDriver was started successfully. And if I specify the webdriver path, the webdriver log is: Started executable: `/my_path_to/msedgedriver` in a child process with pid: 1665688
Starting Microsoft Edge WebDriver 115.0.1901.200 (64b0164e9f6a43a530acd52f6525ddd6fe990817) on port 45075
To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver
Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.
Microsoft Edge WebDriver was started successfully.
There seems no errors during launching the msedgedriver. Maybe something happened when the msedgedriver launches the edge browser. How could I get the detailed info? |
Here's how you get the driver logs for Edge - https://www.selenium.dev/documentation/webdriver/browsers/edge/#service |
I set the msedgedriver log level to ALL. from selenium import webdriver
from selenium.webdriver.edge.service import Service
executable_path = '/my_path_to/msedgedriver'
service = Service(executable_path=executable_path, log_path='my.log', service_args=['--log-level=ALL', '--readable-timestamp'])
driver = webdriver.Edge(service=service)
driver.quit() It's strange that the msedgedriver indeed launches /usr/bin/google-chrome, even if I set Edge as the default browser. [08-10-2023 16:12:03.238302][INFO]: Starting Microsoft Edge WebDriver 115.0.1901.200 (64b0164e9f6a43a530acd52f6525ddd6fe990817) on port 58289
[08-10-2023 16:12:03.238487][INFO]: Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.
[08-10-2023 16:12:03.740966][INFO]: [5806e954c2b3f9bd2aa98aa7428912ff] COMMAND InitSession {
"capabilities": {
"alwaysMatch": {
"browserName": "MicrosoftEdge",
"ms:edgeOptions": {
"args": [ ],
"extensions": [ ]
},
"pageLoadStrategy": "normal"
},
"firstMatch": [ {
} ]
}
}
[08-10-2023 16:12:03.742252][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_setting_values": {
"geolocation": 1
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[08-10-2023 16:12:03.742444][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": false
}
}
}
[08-10-2023 16:12:03.742782][INFO]: Launching Microsoft Edge: /usr/bin/google-chrome --allow-pre-commit-input --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-logging --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.microsoft.Edge.rW5F82 data:,
DevTools listening on ws://127.0.0.1:43721/devtools/browser/4b87fbc3-fd98-4f49-a9ed-a98a30f59d50
[08-10-2023 16:12:03.898148][DEBUG]: DevTools HTTP Request: http://localhost:43721/json/version
[08-10-2023 16:12:03.945883][DEBUG]: DevTools HTTP Response: {
"Browser": "Chrome/115.0.5790.170",
"Protocol-Version": "1.3",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"V8-Version": "11.5.150.22",
"WebKit-Version": "537.36 (@cc0d30c2ca5577520c8646671513241faa0bc105)",
"webSocketDebuggerUrl": "ws://localhost:43721/devtools/browser/4b87fbc3-fd98-4f49-a9ed-a98a30f59d50"
}
......
[08-10-2023 16:13:03.687914][DEBUG]: DevTools HTTP Request: http://localhost:43721/json/version
[08-10-2023 16:13:03.692351][DEBUG]: DevTools HTTP Response: {
"Browser": "Chrome/115.0.5790.170",
"Protocol-Version": "1.3",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"V8-Version": "11.5.150.22",
"WebKit-Version": "537.36 (@cc0d30c2ca5577520c8646671513241faa0bc105)",
"webSocketDebuggerUrl": "ws://localhost:43721/devtools/browser/4b87fbc3-fd98-4f49-a9ed-a98a30f59d50"
}
[08-10-2023 16:13:03.747474][INFO]: Failed to connect to msedge. Attempting to kill it.
[08-10-2023 16:13:03.777294][INFO]: [5806e954c2b3f9bd2aa98aa7428912ff] RESPONSE InitSession ERROR unknown error: unrecognized Microsoft Edge version: Chrome/115.0.5790.170
[08-10-2023 16:13:03.777327][DEBUG]: Log type 'driver' lost 0 entries on destruction
[08-10-2023 16:13:03.777336][DEBUG]: Log type 'browser' lost 0 entries on destruction Is any one able to reproduce this issue? |
A few things...
But also, Selenium 4.11 should not be affected by this bug! Selenium locates the correct browser, gets the right driver, then passes the location of the browser to the driver. Since your logs aren't showing that, something isn't right in your setup. Update to Selenium 4.11 and remove existing drivers from your system and it should do what you expect. |
Hi, @fz0000. You can see if the feature is passing in the Web Platform Tests. If it is something new, please create an Issue with the MSEdgeDriver team. Feel free to comment the issues that you raise back in this issue. Thank you. |
Yes, a similar issue has been tracked in MSEdgeDriver team recently, if anyone meets the same issue, please refer to MicrosoftEdge/EdgeWebDriver#102 for details. Thanks everyone. |
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?
I have installed both Google Chrome and Microsoft Edge on Ubuntu.
Default setting(i.e.
webdriver.Edge()
without params) works correctly.But when I use a specific webdriver path, Chrome is launched unexpectedly.
So I have to specify the msedge binary location too, as a workaround:
btw, this issue does NOT occur on Windows.
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu 23.04
Selenium version
4.11.2
What are the browser(s) and version(s) where you see this issue?
Edge 115.0.1901.200
What are the browser driver(s) and version(s) where you see this issue?
Microsoft Edge WebDriver 115.0.1901.200 (64b0164e9f6a43a530acd52f6525ddd6fe990817)
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: