Closed Bug 1260959 Opened 8 years ago Closed 8 years ago

Navigate to localhost

Categories

(Remote Protocol :: Marionette, defect)

45 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: titus.fortner, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

Steps to reproduce:

I'm not sure if this is a bug, but I can do this with all other browsers right now (including Firefox)

This is on Windows 10 if that matters.
https://gist.github.com/titusfortner/440bb2ed66c3968d3dec9e534e9e60c9


Actual results:

Error


Expected results:

Navigate to localhost
It would be very helpful if you could list some code you were executing here.
Flags: needinfo?(titus.fortner)
Can you also provide the document that is loaded?  In our automation Marionette loads from http://localhost/ all the time, so I think the bug description here is inaccurate.
Sorry for the confusion; there are 2 commands there.

This works fine:
driver.navigate.to "http://localhost:8180/"

This does not:
driver.navigate.to "localhost:8180/"

W3C doesn't say anything about this, I just wanted to point out that it is different from the behavior of both Chrome & Firefox.
Flags: needinfo?(titus.fortner)
In http://w3c.github.io/webdriver/webdriver-spec.html#go which references https://url.spec.whatwg.org/#concept-url for a URL. We are currently following the spec which all drivers are implementing. 

Since you can't call a normal website without the scheme see below I am a little loathed to add it for localhost as it will lead to issues that people wouldnt understand.

>>> f.get("google.com")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dburns/.virtualenvs/spec/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 245, in get
    self.execute(Command.GET, {'url': url})
  File "/Users/dburns/.virtualenvs/spec/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
    self.error_handler.check_response(response)
  File "/Users/dburns/.virtualenvs/spec/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Target URL google.com is not well-formed.
Stacktrace:
    at FirefoxDriver.prototype.get (file:///var/folders/7n/2f615rtj42l0ppz5jg_nch0c0000gp/T/tmp9Kmdhd/extensions/fxdriver@googlecode.com/components/driver-component.js:10636)
    at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/7n/2f615rtj42l0ppz5jg_nch0c0000gp/T/tmp9Kmdhd/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
    at DelayedCommand.prototype.executeInternal_ (file:///var/folders/7n/2f615rtj42l0ppz5jg_nch0c0000gp/T/tmp9Kmdhd/extensions/fxdriver@googlecode.com/components/command-processor.js:12666)
    at DelayedCommand.prototype.execute/< (file:///var/folders/7n/2f615rtj42l0ppz5jg_nch0c0000gp/T/tmp9Kmdhd/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.