因此,我正在尝试使用Chrome驱动程序对金牛座和硒进行简单的测试。
ubuntuXXXXXX$ chromedriver --version
ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72)
ubuntuXXXXXX$ google-chrome --version && which google-chrome
Google Chrome 73.0.3683.103
/usr/bin/google-chrome
错误日志:
INFO: Create JUnit 4 request with following arguments: [aws.BookAFlightNew]
Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 28517
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1555756176.632][INFO]: [44084fb1ebc5abbc49f588f6d30790a8] COMMAND InitSession {
"capabilities": {
"alwaysMatch": {
"goog:chromeOptions": {
"args": [ ],
"extensions": [ ]
}
},
"desiredCapabilities": {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ ],
"extensions": [ ]
}
},
"firstMatch": [ {
"browserName": "chrome"
} ],
"requiredCapabilities": {
}
},
"desiredCapabilities": {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ ],
"extensions": [ ]
}
},
"requiredCapabilities": {
}
}
[1555756176.632][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_setting_values": {
"geolocation": 1
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[1555756176.632][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": false
}
}
}
[1555756176.632][INFO]: Launching chrome: /usr/bin/google-chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension=/tmp/.com.google.Chrome.gVwWj6/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.S44UB0 data:,
[1555756176.734][INFO]: [44084fb1ebc5abbc49f588f6d30790a8] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
[1555756176.734][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1555756176.734][DEBUG]: Log type 'browser' lost 0 entries on destruction
将无头chrome视图添加到配置文件时,测试通过。
我想念什么?