У меня проблема с обнаруженными объектами.
мой env:
- Элемент списка
- chromedriver and chrome - 77
- selenium-server-standalone-3.141.59.jar
- node.js - 10.16.3
- java jdk - 1.8.0.221
test: demo.js
module.exports = {
'Demo test Ecosia.org': function (browser) {
browser
.url('https://www.ecosia.org/')
.assert.titleContains('Ecosia')
.assert.visible('input[type=search]')
.setValue('input[type=search]', 'nightwatch')
.assert.visible('button[type=submit]')
.click('button[type=submit]')
.assert.containsText('.mainline-results', 'Nightwatch.js')
.end();
}
};
nightwatch.json
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"page_objects_path": "./pages",
"selenium" : {
"start_process" : true,
"server_path" : "lib/drivers/selenium-server-standalone-3.141.59.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "lib/drivers/chromedriver.exe"
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent" : true,
"screenshots" : {
"enabled" : true,
"path" : "screenshots",
"on_failure" : true
},
"desiredCapabilities" : {
"browserName" : "chrome",
"marionette" : "true",
"javascriptEnabled": true,
"acceptSslCerts": true
},
"acceptSslCerts" : false,
"use_xpath" : true
}
}
}
package.json
{
"name": "vs_studio",
"version": "1.0.0",
"description": "to learn automation testing",
"main": "nightwatch.js",
"scripts": {
"test": ""
},
"author": "Michal",
"license": "ISC",
"dependencies": {
"nightwatch": "^1.2.4"
},
"devDependencies": {
"chromedriver": "^77.0.0",
"geckodriver": "^1.18.0"
}
}
ниже результата выполнения теста:
[Demo] Test Suite
=================
Running: Demo test Ecosia.org
√ Testing if the page title contains "Ecosia" - 17 ms.
NoSuchElementError: An error occurred while running .isVisible() command on <input[type=search]>:
at process._tickCallback (internal/process/next_tick.js:68:7)
× Testing if element <input[type=search]> is visible. Element could not be located in 1000 ms. - expected "true" but got: "null"
at Object.Demo test Ecosia.org (C:\Users\mincberm\Documents\VS_Studio\tests\demo.js:6:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
FAILED: 1 assertions failed, 1 errors and 1 passed (7.352s)
_________________________________________________
TEST FAILURE: 1 error during execution 1 assertions failed, 1 passed. 14.576s
× demo
– Demo test Ecosia.org (7.352s)
Testing if element <input[type=search]> is visible. Element could not be located in 1000 ms. - expected "true" but got: "null"
at Object.Demo test Ecosia.org (C:\Users\mincberm\Documents\VS_Studio\tests\demo.js:6:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
NoSuchElementError: An error occurred while running .isVisible() command on <input[type=search]>:
at process._tickCallback (internal/process/next_tick.js:68:7)
я пытаюсь выполнить тестна Chrome (версии 71, 74, 75 и 77) и на нескольких версиях Firefox и у меня есть тот же провлем