2017-04-05 70 views
1

我使用nightwatch.js測試網站。
3天前,它的工作,但因爲明天它沒有工作。
當我試圖用$ nightwatch <test_file>測試(因爲我全球的裝機量nightwatch,和它的工作了一個月。),這表明Starting selenium server...,做沒有什麼。
使用--verbose不顯示任何東西。這也恰恰說明了Starting selenium server... 我更新chromedriver,nightwatch和NPM,但相同的。

nightwatch停留在啓動硒服務器

我使用Ubuntu 16.04.1 LTS,AMD64
chromedriver_linux64.zip
nightwatch 0.9.14
硒的服務器獨立-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 
     } 
    } 
    } 
} 

回答

3

我解決了它。 這是因爲硒獨立服務器進程仍在運行。 我殺了它,並測試作品。

+0

好一個!!!!!!!!!! – SuperUberDuper

1

同樣,這發生在我身上,由於端口衝突。如果其他進程在4444上運行,Selenium不會啓動,Nightwatch也不會告訴你這個錯誤。

更改,該端口4445,在nightwatch.json,固定對我來說: "selenium" : { ... "port" : 4445,