【问题标题】:nightwatch stuck on starting selenium servernightwatch 卡在启动 selenium 服务器上
【发布时间】:2017-04-05 08:51:38
【问题描述】:

我正在使用 nightwatch.js 来测试网站。
2天前,它工作,但从明天开始它没有工作。
当我尝试使用$ nightwatch <test_file> 进行测试时(因为我在全球范围内安装了守夜人。它工作了一个月。),它显示Starting selenium server... 并且什么也没有。
使用 --verbose 不会显示任何其他内容。它也只显示Starting selenium server... 我更新了 chromedriver、nightwatch 和 npm,但还是一样。

我使用的是 Ubuntu 16.04.1 LTS,amd64
chromedriver_linux64.zip
守夜人 0.9.14
selenium-server-standalone-3.3.1


这是我的 nightwatch.json

{
  "src_folders" : ["tests/e2e"],
  "output_folder" : "tests/reports",
  "custom_commands_path" : "tests/custom",
  "custom_assertions_path" : "",
  "page_objects_path" : "",
  "globals_path" : "",
  "selenium" : {
    "start_process" : true,
    "server_path" : "./bin/selenium-server-standalone-3.3.1.jar",
    "log_path" : "tests/logs",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "./chromedriver",
      "webdriver.ie.driver" : ""
    }
  },
  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_port"  : 4444,
      "selenium_host"  : "localhost",
      "silent": true,
      "screenshots": {
        "enabled" : true,
        "on_failure" : true,
        "on_error" : false,
        "path" : "tests/screenshots"
      },
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}

【问题讨论】:

    标签: node.js selenium selenium-chromedriver nightwatch.js


    【解决方案1】:

    我解决了。 这是因为 selenium-standalone-server 进程仍在运行。 我杀了它,测试成功了。

    【讨论】:

      【解决方案2】:

      同样,由于端口冲突,这发生在我身上。如果其他进程在 4444 上运行,Selenium 将不会启动,并且 Nightwatch 不会告诉您错误。

      在 nightwatch.json 中将端口更改为 4445,为我修复了它: "selenium" : { ... "port" : 4445,

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-04-15
        • 2023-04-02
        • 1970-01-01
        • 1970-01-01
        • 2019-12-10
        • 2011-12-07
        相关资源
        最近更新 更多