提交 25bfd5bd 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

selenium find `chromedriver.exe` by default under win32, so we have to specify...

selenium find `chromedriver.exe` by default under win32, so we have to specify the `chromedriver`.path in order to make it work with npm module `chromedriver`
上级 fc2bd28a
......@@ -75,15 +75,20 @@ export class BrowserDriver {
* issue #56
* only need under win32 with cygwin
* and will cause strange error:
* `The previously configured ChromeDriver service is still running. You must shut it down before you may adjust its configuration.`
*
*/
const chrome = require('selenium-webdriver/chrome')
const path = require('chromedriver').path
const service = new chrome.ServiceBuilder(path).build()
chrome.setDefaultService(service)
*/
try {
chrome.setDefaultService(service)
} catch (e) { // fail safe
/**
* `The previously configured ChromeDriver service is still running.`
* `You must shut it down before you may adjust its configuration.`
*/
}
const options = {
args: ['--no-sandbox'] // issue #26 for run inside docker
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册