The version of firefox cannot be detected. Trying with latest driver version
Categories
(Testing :: geckodriver, defect, P5)
Tracking
(Not tracked)
People
(Reporter: debanjanb, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Steps to reproduce:
Used a basic Selenium 4.10.0 (Selenium Manager) & Python 3.10.10 program:
import sys
print ("Python Version: " +sys.version)
print ("Python version: "+str(sys.version_info))
from platform import python_version
print("Python Version: " +python_version())
import selenium
print("Selenium Version: " +selenium.__version__)
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'
driver = webdriver.Chrome(options=options)
driver.get("https://www.tripadvisor.com/Attraction_Products-g28922-t21629-zfg21594-Alabama.html")
Actual results:
Selenium produces the log:
Python Version: 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Python version: sys.version_info(major=3, minor=10, micro=10, releaselevel='final', serial=0)
Python Version: 3.10.10
Selenium Version: 4.10.0
The version of firefox cannot be detected. Trying with latest driver version
All though Selenium finally opens the Firefox browser.
Expected results:
Selenium shouldn't generate the log:
The version of firefox cannot be detected. Trying with latest driver version
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
No Bugbug this isn't related to PDF Viewer.
Comment 3•2 years ago
|
||
Creating a driver for Chrome will indeed not work with Firefox. A Firefox driver has to be created with webdriver.Firefox()
.
Sorry for the Inconvenience. I pasted it wrong. Originally it was:
options = Options()
options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'
driver = webdriver.Firefox(options=options)
driver.get("https://www.opensanctions.org/datasets/default/")
and I'm still able to reproduce the issue.
Comment 5•2 years ago
|
||
Would you mind creating a trace log and attaching it to this bug? Thanks. I'm reopening the bug for now.
Updated•2 years ago
|
I followed the sample code in https://firefox-source-docs.mozilla.org/testing/geckodriver/TraceLogs.html#python page to generate trace level logs as follows:
import sys
print ("Python Version: " +sys.version)
print ("Python version: "+str(sys.version_info))
from platform import python_version
print("Python Version: " +python_version())
import selenium
print("Selenium Version: " +selenium.__version__)
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.log.level = "trace"
options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'
# https://github.com/SeleniumHQ/selenium/issues/12300
# [rust] Use escaped browser path (required by wmic commands) in Selenium Manager
# https://github.com/SeleniumHQ/selenium/pull/12304
# options.binary_location = r'C:\\Program Files\\Mozilla Firefox\\firefox.exe'
driver = webdriver.Firefox(options=options)
driver.get("https://www.opensanctions.org/datasets/default/")
Though geckodriver.log gets created but it remains empty.
Console output:
Python Version: 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Python version: sys.version_info(major=3, minor=10, micro=10, releaselevel='final', serial=0)
Python Version: 3.10.10
Selenium Version: 4.10.0
The version of firefox cannot be detected. Trying with latest driver version
Comment 7•2 years ago
|
||
Is the Firefox installation at C:\\Program Files\\Mozilla Firefox\\firefox.exe
a 32bit or 64bit binary? Also which geckodriver binary are you using? Both geckodriver and Firefox need to be the same architecture means a 64bit geckodriver won't find a 32bit Firefox installation.
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Debanjanb if you have some further feedback we would appreciate. If we don't get a response I'll go ahead and close the bug by next week Monday given that I would assume that you were using a mixture between 32bit and 64bit platforms. Thanks.
Updated•2 years ago
|
Updated•11 months ago
|
Description
•