当我尝试捕获“ message”:“未知错误:无法读取null的属性'click'时,以下代码永远不会出现在捕获部分。处理错误时我在做什么那个executeScript()函数?
.then(function() {
try {
//element name was changed to force the error
return _super.driver.executeScript("document.querySelector('.BLAHement button').click()");
} catch (err) {
//this part is never triggered
winston.info('Trying one more time');
_super.forceWait(5);
return _super.driver.executeScript("document.querySelector('.myelement button').click()");
}
})