Вызов.init() приводит к "Ошибка при выполнении действия протокола.locateMultipleElements(): неверный идентификатор сеанса"
Выполнение простого теста (ниже) с .init()
и основной nightwatch.json
результаты в:
[Test1] Test Suite
==================
Running: Google Search
Error while running .locateMultipleElements() protocol action: invalid session id (x9)
NoSuchElementError: Error while running "waitForElementVisible" command: Timed out while waiting for element "input[name="q"]" with "css selector" to be present for 4000 millise
Комментируя .init()
и используя .url()
- работает отлично. Подобные скрипты использовались для работы со старой версией NW - не уверен, какой
NW v.1.1.11
selenium-server-standalone-3.141.59.jar
chromedriver 74.0.3729.6
linux 16
node 12.3.1
module.exports = {
'Google Search' : function (browser) {
browser
.init()
// .url('https://www.google.com')
.waitForElementVisible('input[name="q"]', 4000)
.setValue('input[name="q"]', 'hello world')
.keys(browser.Keys.ENTER)
.waitForElementVisible('#resultStats', 4000)
.assert.urlContains('q=hello+world')
.end();
}
};
Config:
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"selenium" : {
"start_process" : true,
"server_path" : "/usr/local/bin/selenium-server-standalone-3.141.59.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "/usr/local/bin/chromedriver"
}
},
"test_settings" : {
"default" : {
"launch_url" : "https://www.google.com",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "chrome"
}
}
}
}