Selenium 无法在夜间监视中启动幻影驱动程序

Selenium 无法在夜间监视中启动幻影驱动程序,selenium,nightwatch.js,Selenium,Nightwatch.js,Chrome驱动程序可以正确启动,但切换到phantomjs时失败。 奇怪的是,selenium进程似乎挂在那里,没有输出,这很难调试 我在WIN7上使用笔记本电脑,从官方网站下载phantomjs.exe。 因为对夜间守夜很陌生,有什么建议或帮助吗 非常感谢 这是我的nightwatch.json配置 { "src_folders": "tests", "output_folder": "reports", "custom_commands_path": "", "custom_asserti

Chrome驱动程序可以正确启动,但切换到phantomjs时失败。 奇怪的是,selenium进程似乎挂在那里,没有输出,这很难调试

我在WIN7上使用笔记本电脑,从官方网站下载phantomjs.exe。 因为对夜间守夜很陌生,有什么建议或帮助吗

非常感谢

这是我的nightwatch.json配置

{
"src_folders": "tests",
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",

"selenium": {
    "start_process": true,
    "server_path": "lib/selenium-server-standalone-2.45.0.jar",
    "log_path": "log",
    "host": "127.0.0.1",
    "port": 4444,
    "cli_args": {
        "webdriver.chrome.driver": "drivers/chromedriver.exe",
        "webdriver.phantomjs.driver": "drivers/phantomjs.exe"
    }
},

"test_settings": {
    "default": {
        "selenium_port": 4444,
        "selenium_host": "localhost",
        "silent": false,
        "desiredCapabilities": {
            "browserName": "phantomjs",
            "javascriptEnabled": true,
            "acceptSslCerts": true
        }
    },
    "firefox": {
        "selenium_port": 4444,
        "selenium_host": "localhost",
        "silent": true,
        "desiredCapabilities": {
            "browserName": "firefox",
            "javascriptEnabled": true,
            "acceptSslCerts": true
        }
    },
    "phantomjs": {
        "selenium_port": 4444,
        "selenium_host": "localhost",
        "silent": true,
        "desiredCapabilities": {
            "browserName": "phantomjs",
            "javascriptEnabled": true,
            "acceptSslCerts": true
        }
    }
}

问题解决了,这是因为在“desiredCapabilities”中遗漏了二进制路径。 然而,这并不酷,幻影是如此独特,而其他人不需要设置这个

"phantomjs" : {
      "desiredCapabilities" : {
        "browserName" : "phantomjs",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true,
        "phantomjs.binary.path" : "/path/to/phantomjs" //need this line!!!
      }
    },