Issue metadata
Sign in to add a comment
|
When use headless mode, got Failed Provisional Load error [error_code: -501, error_description: , showing_repost_interstitial: 0, frame_id: 1]
Reported by
wenzhany...@gmail.com,
Nov 20 2017
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Steps to reproduce the problem:
1. Use selenium build the driver:
const chromeCapabilities = webdriver.Capabilities.chrome();
const chromeOptions = {
args: ['headless', 'window-size=1400,1000', '--disable-gpu',
'--enable-logging',
'--v=1',
'--ignore-certificate-errors',
]
};
chromeCapabilities.set('acceptSslCerts', true);
chromeCapabilities.set('chromeOptions', chromeOptions);
this.driver = new webdriver.Builder()
.forBrowser('chrome')
// .setProxy(proxyConfig)
.withCapabilities(chromeCapabilities)
.build();
and the base url is: https://localhost/home.
2. When run the script.
What is the expected behavior?
The page will load and run other scripts.
When use normal mode(no headless) is work well.
const chromeCapabilities = webdriver.Capabilities.chrome();
const chromeOptions = {
args: ['--test-type', '--start-maximized']
};
chromeCapabilities.set('acceptSslCerts', true);
chromeCapabilities.set('chromeOptions', chromeOptions);
this.driver = new webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
.build();
What went wrong?
The page not load: https://localhost/home
09:24:07.722 DEBUG selenium-nodejs.HomePage: navigate
[1120/092408.090:VERBOSE1:network_delegate.cc(31)] NetworkDelegate::NotifyBeforeURLRequest: https://localhost/home
[1120/092408.403:VERBOSE1:navigator_impl.cc(242)] Failed Provisional Load: https://localhost/home, error_code: -501, error_description: , showing_repost_interstitial: 0, frame_id: 1
Did this work before? No
Chrome version: 62.0.3202.94 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
,
Nov 22 2017
Have a solution to ignore the Certificate now? Or other solution? Thanks a lot!
,
Nov 22 2017
I'm not familiar with selenium, but I wonder if the problem is that you have "--" in front of some of the args array and not others? Maybe it expects you to specify args with no -- in front? Alternatively you could try --allow-insecure-localhost, which appears should work in headless: https://cs.chromium.org/chromium/src/headless/lib/browser/headless_content_browser_client.cc?rcl=26ebf15fcb6f642fb7c0d19ceb3fd6df2918c7dd&l=305 Let us know if either of those helps.
,
Nov 23 2017
Thanks a lot. Use args "--allow-insecure-localhost" the localhost Certificate problem resolved. But how to ignore the Certificate when the url is not localhost?
,
Nov 23 2017
[1123/103500.920:VERBOSE1:navigator_impl.cc(242)] Failed Provisional Load: https://10.175.192.123/home, error_code: -118, error_description: , showing_repost_interstitial: 0, frame_id: 1
,
Nov 23 2017
Thank you for providing more feedback. Adding requester "mattm@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 23 2017
Looks like there isn't a way currently. If you want to use non-localhost certs I guess issue 721739 is the one to track. (I was going to suggest --ignore-certificate-errors-spki-list but it looks like headless mode using the default CertVerifier from UrlRequestContextBuilder: https://cs.chromium.org/chromium/src/headless/lib/browser/headless_url_request_context_getter.cc?rcl=11cab721ee2309a9adfa496a047afe2add401059&l=86 So --ignore-certificate-errors-spki-list probably won't work with headless mode either.) |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by davidben@chromium.org
, Nov 20 2017