Home > Net >  WebDriverError@chrome instead of WebDriverError@firefox while using Firefox browser with selenium
WebDriverError@chrome instead of WebDriverError@firefox while using Firefox browser with selenium

Time:07-26

I'm trying to write several tests using selenium, but I'm seeing the following strange behavior. When I run the tests like this:

from selenium.webdriver import Firefox, FirefoxOptions
from selenium.webdriver.firefox.service import Service

options = FirefoxOptions()
service = Service()

brow = Firefox(service=service, options=options)
brow.execute("get", {'url': 'https://python.org'})

I get the result I expected, the python.org website is opened in Firefox browser.

But if I make a mistake in URL, I'm getting the following error:

from selenium.webdriver import Firefox, FirefoxOptions
from selenium.webdriver.firefox.service import Service

options = FirefoxOptions()
service = Service()

brow = Firefox(service=service, options=options)
brow.execute("get", {'url': 'qwerty'})
selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor: qwerty is not a valid URL.
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:186:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.jsm:315:5
GeckoDriver.prototype.navigateTo@chrome://remote/content/marionette/driver.js:804:11

I just want to understand why I see here WebDriverError@chrome, and not WebDriverError@firefox or something like that.

Is this a bug, or am I doing something wrong?

CodePudding user response:

These error messages...

WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:186:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.jsm:315:5
GeckoDriver.prototype.navigateTo@chrome://remote/content/marionette/driver.js:804:11

containing the phrase @chrome may leave an impression of a strange behavior while using GeckoDriver and combo.

However, as per @AutomatedTester's comment in the GitHub discussion Selenium 3.4.0-GeckoDriver 0.17.0 : GeckoDriver producing logs through Chromium/Chrome modules #787:

These errors are nothing to worry about. Mozilla uses different open source projects to build Firefox for different reasons. It showing Chrome errors means nothing in the big picture.

So you can ignore them safely.

  • Related