Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigating to a valid but unreachable domain is not an error #770

Open
2 tasks done
shs96c opened this issue Jun 6, 2017 · 11 comments
Open
2 tasks done

Navigating to a valid but unreachable domain is not an error #770

shs96c opened this issue Jun 6, 2017 · 11 comments

Comments

@shs96c
Copy link

shs96c commented Jun 6, 2017

In order to help us efficiently investigate your issue, please provide the following information:

Platform and application details

  • Platform: OS X
  • Firefox: 55.0a1 (2017-06-06) (64-bit)
  • Selenium: Java, 3.5-prerelease

Steps to reproduce

WebDriver driver = new FirefoxDriver();
// A valid domain, but without a server listening
driver.get("http://localhost:4567");

It is expected for the driver to return a value of success with a value of null, as per the Go Command spec. The URL is valid and absolute, so we should pass the check in step 5.

  • Reproducable testcase:
    See above

  • A trace level log:

1496758172897	webdriver::httpapi	DEBUG	Creating routes
1496758172976	geckodriver	INFO	Listening on 127.0.0.1:4444
1496758207114	webdriver::server	DEBUG	→ POST /wd/hub/session {
  "desiredCapabilities": {
    "acceptInsecureCerts": true,
    "browserName": "firefox",
    "version": "",
    "platform": "ANY"
  },
  "requiredCapabilities": {},
  "capabilities": {
    "desiredCapabilities": {
      "acceptInsecureCerts": true,
      "browserName": "firefox",
      "version": "",
      "platform": "ANY"
    },
    "requiredCapabilities": {},
    "alwaysMatch": {
      "acceptInsecureCerts": true
    },
    "firstMatch": [
      {
        "browserName": "firefox"
      }
    ]
  }
}
1496758207224	webdriver::server	DEBUG	← 404 Not Found {"value":{"error":"unknown command","message":"POST /wd/hub/session did not match a known command","stacktrace":"stack backtrace:\n   0:        0x102db16a1 - backtrace::backtrace::trace::h5db1675e0d2383fc\n   1:        0x102db2b94 - backtrace::capture::Backtrace::new::h8ca3ad60a3bf61a1\n   2:        0x102d239f4 - webdriver::error::WebDriverError::new::h0b8014f85bb1d206\n   3:        0x102cc52ef - _$LT$webdriver..httpapi..WebDriverHttpApi$LT$U$GT$$GT$::decode_request::h3f9064803ad39dd1\n   4:        0x102d07cf9 - _$LT$webdriver..server..HttpHandler$LT$U$GT$$u20$as$u20$hyper..server..Handler$GT$::handle::h9cc5473a434f5911\n   5:        0x102c3b589 - _$LT$hyper..server..Worker$LT$H$GT$$GT$::keep_alive_loop::h2f43cf06235aa6ac\n   6:        0x102c3c1d3 - _$LT$hyper..server..Worker$LT$H$GT$$GT$::handle_connection::hbcecfbb72c577608\n   7:        0x102cd2857 - hyper::server::handle::_$u7b$$u7b$closure$u7d$$u7d$::h60edbeedd4916a50\n   8:        0x102cd2db7 - hyper::server::listener::spawn_with::_$u7b$$u7b$closure$u7d$$u7d$::hec66d93e85c60e6e\n   9:        0x102d1726e - _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::ha2533d0f6c31e0cd\n  10:        0x102c4fb5d - std::panicking::try::do_call::h76f781f12ef05cfd\n  11:        0x10330f92a - __rust_maybe_catch_panic\n  12:        0x102c4f330 - std::panicking::try::hdebd992edef22fb6\n  13:        0x102c4c058 - std::panic::catch_unwind::h6207ab288f9d0c46\n  14:        0x102c4e342 - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::h55735d708e38787f\n  15:        0x102cad3e6 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h1dd0cf441f74e724\n  16:        0x10330dd54 - std::sys::imp::thread::Thread::new::thread_start::hf2762ec0b24c4077\n  17:     0x7fffd836f93a - _pthread_body\n  18:     0x7fffd836f886 - _pthread_start"}}
1496758215688	webdriver::server	DEBUG	→ POST /session {
  "desiredCapabilities": {
    "acceptInsecureCerts": true,
    "browserName": "firefox",
    "version": "",
    "platform": "ANY"
  },
  "requiredCapabilities": {},
  "capabilities": {
    "desiredCapabilities": {
      "acceptInsecureCerts": true,
      "browserName": "firefox",
      "version": "",
      "platform": "ANY"
    },
    "requiredCapabilities": {},
    "alwaysMatch": {
      "acceptInsecureCerts": true
    },
    "firstMatch": [
      {
        "browserName": "firefox"
      }
    ]
  }
}
1496758215731	geckodriver::capabilities	DEBUG	Trying to read firefox version from ini files
1496758215733	geckodriver::capabilities	DEBUG	Found version 55.0a1
1496758215758	geckodriver::marionette	INFO	Starting browser /Applications/Firefox.app/Contents/MacOS/firefox-bin with args ["-marionette"]
1496758215775	geckodriver::marionette	TRACE	  connection attempt 0/600
1496758215878	geckodriver::marionette	TRACE	  connection attempt 1/600
1496758215979	geckodriver::marionette	TRACE	  connection attempt 2/600
1496758216084	geckodriver::marionette	TRACE	  connection attempt 3/600
1496758216191	geckodriver::marionette	TRACE	  connection attempt 4/600
1496758216297	geckodriver::marionette	TRACE	  connection attempt 5/600
1496758216399	geckodriver::marionette	TRACE	  connection attempt 6/600
1496758216503	geckodriver::marionette	TRACE	  connection attempt 7/600
1496758216606	geckodriver::marionette	TRACE	  connection attempt 8/600
1496758216708	geckodriver::marionette	TRACE	  connection attempt 9/600
1496758216812	geckodriver::marionette	TRACE	  connection attempt 10/600
1496758216914	geckodriver::marionette	TRACE	  connection attempt 11/600
1496758217015	geckodriver::marionette	TRACE	  connection attempt 12/600
1496758217119	geckodriver::marionette	TRACE	  connection attempt 13/600
1496758217222	geckodriver::marionette	TRACE	  connection attempt 14/600
1496758217328	geckodriver::marionette	TRACE	  connection attempt 15/600
1496758217428	geckodriver::marionette	TRACE	  connection attempt 16/600
1496758217531	geckodriver::marionette	TRACE	  connection attempt 17/600
1496758217634	geckodriver::marionette	TRACE	  connection attempt 18/600
1496758217739	geckodriver::marionette	TRACE	  connection attempt 19/600
1496758217842	geckodriver::marionette	TRACE	  connection attempt 20/600
1496758217946	geckodriver::marionette	TRACE	  connection attempt 21/600
1496758218051	geckodriver::marionette	TRACE	  connection attempt 22/600
1496758218156	geckodriver::marionette	TRACE	  connection attempt 23/600
1496758218261	geckodriver::marionette	TRACE	  connection attempt 24/600
1496758218366	geckodriver::marionette	TRACE	  connection attempt 25/600
1496758218472	geckodriver::marionette	TRACE	  connection attempt 26/600
1496758218575	geckodriver::marionette	TRACE	  connection attempt 27/600
1496758218680	geckodriver::marionette	TRACE	  connection attempt 28/600
1496758218783	geckodriver::marionette	TRACE	  connection attempt 29/600
1496758218883	Marionette	DEBUG	Setting recommended pref toolkit.cosmeticAnimations.enabled to false
1496758218884	Marionette	DEBUG	Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false
1496758218884	Marionette	INFO	Listening on port 57770
1496758218887	geckodriver::marionette	DEBUG	Connected to Marionette on localhost:57770
1496758218898	Marionette	DEBUG	Accepted connection 0 from 127.0.0.1:57838
1496758218910	geckodriver::marionette	TRACE	<- {"applicationType":"gecko","marionetteProtocol":3}
1496758218911	geckodriver::marionette	TRACE	-> 163:[0,1,"newSession",{"acceptInsecureCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptInsecureCerts":true,"browserName":"firefox"}}}]
1496758218927	Marionette	TRACE	0 -> [0,1,"newSession",{"acceptInsecureCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptInsecureCerts":true,"browserName":"firefox"}}}]
1496758218932	Marionette	CONFIG	Matched capabilities: {"browserName":"firefox","browserVersion":"55.0a1","platformName":"darwin","platformVersion":"16.6.0","pageLoadStrategy":"normal","acceptInsecureCerts":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":8876,"moz:profile":"/var/folders/6m/70gf06zx02xgxzyrkwpmvwth0000gn/T/rust_mozprofile.CKE7r9fTMfKM","moz:accessibilityChecks":false}
1496758218933	Marionette	WARN	TLS certificate errors will be ignored for this session
2017-06-06 15:10:18.934 plugin-container[8877:1229765] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xb43b, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-06-06 15:10:18.938 plugin-container[8877:1229765] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xb803, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
1496758218987	Marionette	DEBUG	loaded listener.js
1496758218996	Marionette	TRACE	0 <- [1,1,null,{"sessionId":"e814054b-2e25-124b-91cf-5d32adcf3c73","capabilities":{"browserName":"firefox","browserVersion":"55.0a1","platformName":"darwin","platformVersion":"16.6.0","pageLoadStrategy":"normal","acceptInsecureCerts":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":8876,"moz:profile":"/var/folders/6m/70gf06zx02xgxzyrkwpmvwth0000gn/T/rust_mozprofile.CKE7r9fTMfKM","moz:accessibilityChecks":false}}]
1496758218997	geckodriver::marionette	TRACE	<- [1,1,null,{"sessionId":"e814054b-2e25-124b-91cf-5d32adcf3c73","capabilities":{"browserName":"firefox","browserVersion":"55.0a1","platformName":"darwin","platformVersion":"16.6.0","pageLoadStrategy":"normal","acceptInsecureCerts":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":8876,"moz:profile":"/var/folders/6m/70gf06zx02xgxzyrkwpmvwth0000gn/T/rust_mozprofile.CKE7r9fTMfKM","moz:accessibilityChecks":false}}]
1496758218998	webdriver::server	DEBUG	← 200 OK {"value": {"sessionId":"e814054b-2e25-124b-91cf-5d32adcf3c73","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"55.0a1","moz:accessibilityChecks":false,"moz:processID":8876,"moz:profile":"/var/folders/6m/70gf06zx02xgxzyrkwpmvwth0000gn/T/rust_mozprofile.CKE7r9fTMfKM","pageLoadStrategy":"normal","platformName":"darwin","platformVersion":"16.6.0","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000}}}}
1496758219081	webdriver::server	DEBUG	→ POST /session/e814054b-2e25-124b-91cf-5d32adcf3c73/url {"url":"http://localhost:4567"}
1496758219082	geckodriver::marionette	TRACE	-> 43:[0,2,"get",{"url":"http://localhost:4567"}]
1496758219132	Marionette	TRACE	0 -> [0,2,"get",{"url":"http://localhost:4567"}]
1496758219137	Marionette	DEBUG	Received DOM event "beforeunload" for "about:blank"
1496758219160	Marionette	DEBUG	Received DOM event "beforeunload" for "about:blank"
1496758219163	Marionette	DEBUG	Received DOM event "pagehide" for "about:blank"
1496758219163	Marionette	DEBUG	Received DOM event "unload" for "about:blank"
1496758219255	Marionette	DEBUG	Received DOM event "DOMContentLoaded" for "about:neterror?e=connectionFailure&u=http%3A//localhost%3A4567/&c=UTF-8&f=regular&d=Firefox%20can%27t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A4567."
1496758219271	Marionette	TRACE	0 <- [1,2,{"error":"unknown error","message":"Reached error page: about:neterror?e=connectionFailure&u=http%3A//localhost%3A4567/&c=UTF-8&f=regular&d=Firefox%20can%27t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A4567.","stacktrace":"WebDriverError@chrome://marionette/content/error.js:222:5\nUnknownError@chrome://marionette/content/error.js:500:5\nhandleEvent@chrome://marionette/content/listener.js:246:21\n"},null]
1496758219272	geckodriver::marionette	TRACE	<- [1,2,{"error":"unknown error","message":"Reached error page: about:neterror?e=connectionFailure&u=http%3A//localhost%3A4567/&c=UTF-8&f=regular&d=Firefox%20can%27t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A4567.","stacktrace":"WebDriverError@chrome://marionette/content/error.js:222:5\nUnknownError@chrome://marionette/content/error.js:500:5\nhandleEvent@chrome://marionette/content/listener.js:246:21\n"},null]
1496758219364	webdriver::server	DEBUG	← 500 Internal Server Error {"value":{"error":"unknown error","message":"Reached error page: about:neterror?e=connectionFailure&u=http%3A//localhost%3A4567/&c=UTF-8&f=regular&d=Firefox%20can%27t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A4567.","stacktrace":"stack backtrace:\n   0:        0x102db16a1 - backtrace::backtrace::trace::h5db1675e0d2383fc\n   1:        0x102db2b94 - backtrace::capture::Backtrace::new::h8ca3ad60a3bf61a1\n   2:        0x102d239f4 - webdriver::error::WebDriverError::new::h0b8014f85bb1d206\n   3:        0x102d3192c - geckodriver::marionette::MarionetteSession::response::h1f02ecfa16c8bf22\n   4:        0x102d40441 - geckodriver::marionette::MarionetteConnection::send_command::h2f8f774be6c69684\n   5:        0x102d30272 - _$LT$geckodriver..marionette..MarionetteHandler$u20$as$u20$webdriver..server..WebDriverHandler$LT$geckodriver..marionette..GeckoExtensionRoute$GT$$GT$::handle_command::h7cbcba57563e723c\n   6:        0x102cc7d8f - _$LT$webdriver..server..Dispatcher$LT$T$C$$u20$U$GT$$GT$::run::hc2d7eb30a6beb07a\n   7:        0x102d24968 - webdriver::server::start::_$u7b$$u7b$closure$u7d$$u7d$::h8f5cbfe344a86d3f\n   8:        0x102d170ea - _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h1f5a6a8b64168892\n   9:        0x102c4f999 - std::panicking::try::do_call::h69d2c62578350ae7\n  10:        0x10330f92a - __rust_maybe_catch_panic\n  11:        0x102c4f043 - std::panicking::try::h5629a87b9d2293eb\n  12:        0x102c4bf94 - std::panic::catch_unwind::h3d7338d5982c8d9a\n  13:        0x102c4e9ab - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::hb72c8e7b838e11e9\n  14:        0x102cad482 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hdda1d704e0298690\n  15:        0x10330dd54 - std::sys::imp::thread::Thread::new::thread_start::hf2762ec0b24c4077\n  16:     0x7fffd836f93a - _pthread_body\n  17:     0x7fffd836f886 - _pthread_start"}}
2017-06-06 15:10:19.483 plugin-container[8878:1229854] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xb337, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-06-06 15:10:19.485 plugin-container[8878:1229854] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xb703, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
@whimboo
Copy link
Collaborator

whimboo commented Jun 9, 2017

We clearly pass step 5 and started a navigation as it can be seen in the trace log. But given that the URL is not reachable Firefox displays an error page. As such we hit step 9-1 for the Go command which is: Run the post-navigation checks and return its value if it is an error..

So why should this result in a success and not error?

@whimboo
Copy link
Collaborator

whimboo commented Aug 8, 2017

@shs96c any feedback regarding my last comment?

@bswhb
Copy link

bswhb commented Aug 16, 2017

@whimboo we have the same issue. The problem is on older Firefox like 45, when navigating to an invalid url, it will not throw an exception. But on gecko, the situation is different so that our existing test cases will all fail. Is there any way restoring back to the same behavior as older Firefox?

@whimboo
Copy link
Collaborator

whimboo commented Aug 16, 2017

Well, I don't see it as a problem when checking the current webdriver spec. So we need feedback from @shs96c here. I'm also cc'ing @andreastt and @AutomatedTester in case they are faster with a reply.

@shs96c
Copy link
Author

shs96c commented Aug 16, 2017

The remote server is the thing that's having a problem and tells people this via the status code, but the navigation itself succeeds.

@whimboo
Copy link
Collaborator

whimboo commented Aug 16, 2017

So what about the post navigation checks?

response is a network error

    Return error with error code unknown error. 

Why is that then not a network error?

@shs96c
Copy link
Author

shs96c commented Aug 16, 2017

A network error in this context isn't an OSI layer 7 error, but happening lower in the stack. Examples would include TCP/IP timeouts, connections not being completed, and so on.

@whimboo
Copy link
Collaborator

whimboo commented Aug 16, 2017

Would you mind making this clearer in the webdriver spec? Right now it misses any details and leaves up enough space for interpretation.

@shs96c
Copy link
Author

shs96c commented Aug 16, 2017

I can make that clear. w3c/webdriver#1009

@AutomatedTester
Copy link
Contributor

@Riyaz7364
Copy link

Any solved yet? I'm still facing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants