Closed Bug 1841453 Opened 2 years ago Closed 2 years ago

The version of firefox cannot be detected. Trying with latest driver version

Categories

(Testing :: geckodriver, defect, P5)

Firefox 114
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

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

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.

Component: Untriaged → PDF Viewer

No Bugbug this isn't related to PDF Viewer.

Flags: needinfo?(hskupin)

Creating a driver for Chrome will indeed not work with Firefox. A Firefox driver has to be created with webdriver.Firefox().

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Component: PDF Viewer → geckodriver
Flags: needinfo?(hskupin)
Product: Firefox → Testing
Resolution: --- → INVALID

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.

Would you mind creating a trace log and attaching it to this bug? Thanks. I'm reopening the bug for now.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Flags: needinfo?(debanjanb)

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
Flags: needinfo?(debanjanb) → needinfo?(hskupin)

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.

Flags: needinfo?(hskupin) → needinfo?(debanjanb)
Severity: -- → S3
Priority: -- → P5

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.

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE
Flags: needinfo?(debanjanb)
You need to log in before you can comment on or make changes to this bug.