问题
I'm seeing the same error with below code. Is this a actual bug in initClient()? Any help is appreciated, thanks!
async 'mydemo'(browser){
var nightwatch = require('../node_modules/nightwatch');
var config = require('../nightwatch.json');
console.log(config);
var client = nightwatch.initClient(config.test_settings.default);
var browserObj = client.api();
const homePage = browserObj.page.homepage();
homePage.navigate();
let result = await homePage.api.elements('css selector', 'div.flex.mt-4.v-card.v-sheet.theme--light > div > div > table > tbody > tr');
console.log(" NightWatch Obj Row Length is " + "<->" + result.value.length);
}
Nightwatch.json
{
src_folders: [ 'Tests' ],
page_objects_path: [ 'pageobjects' ],
webdriver: {
start_process: true,
server_path: 'node_modules/chromedriver/lib/chromedriver/chromedriver',
port: 9515
},
test_settings: {
default: {
launch_url: 'http://localhost:8080',
desiredCapabilities: [Object]
}
}
}
Error: FAILED: 1 errors (17ms) TypeError: Cannot read property 'verbose' of null
Please let me know how to create browser object programatically from a nightwatch.json file, thanks!
来源:https://stackoverflow.com/questions/60471945/initclient-nightwatch-typeerror-cannot-read-property-verbose-of-null