[email protected] instead of [email protected] while using Firefox browser with selenium

Issue

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:
[email protected]://remote/content/shared/webdriver/Errors.jsm:186:5
[email protected]://remote/content/shared/webdriver/Errors.jsm:315:5
[email protected]://remote/content/marionette/driver.js:804:11

I just want to understand why I see here [email protected], and not [email protected] or something like that.

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

Solution

These error messages…

[email protected]://remote/content/shared/webdriver/Errors.jsm:186:5
[email protected]://remote/content/shared/webdriver/Errors.jsm:315:5
[email protected]://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.

Answered By – undetected Selenium

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published