My Windows 8マシンでNightwatch.jsをセットアップしようとしましたドライバの実行可能ファイルへのパスは、webドライバの.decko.driverシステムプロパティで設定する必要があります。 Nightwatch
私はnodejs、nightwatch、およびselenium-standalone-sever 3.0.0-beta1.jarをインストールしました。 sample.jsテストを実行しようとすると、次のエラーが発生します。
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" :"",
"custom_assertions_path" :"",
"page_objects_path" :"",
"globals_path":"",
"selenium": {
"start_process" : false,
"server_path" : "",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.ie.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
}
と私sample.jsファイルは、次のとおりです:
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ state: 'unhandled error',
sessionId: null,
hCode: 847580505,
value:
{ localizedMessage: 'The path to the driver executable must be set by the web
driver.gecko.driver system property; for more information, see https://github.co
m/mozilla/geckodriver. The latest version can be downloaded from https://github.
com/mozilla/geckodriver/releases',
cause: null,
suppressed: [],
message: 'The path to the driver executable must be set by the webdriver.ge
cko.driver system property; for more information, see https://github.com/mozilla
/geckodriver. The latest version can be downloaded from https://github.com/mozil
la/geckodriver/releases',
hCode: 294316877,
class: 'java.lang.IllegalStateException',
screen: null },
class: 'org.openqa.selenium.remote.Response',
status: 13 }
私の設定ファイルがある
module.exports = {
'Demo test Google' : function (browser) {
browser
.windowMaximize()
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('#main', 'Night Watch')
.end();
}
};