单击按钮时出现以下错误:失败:元素单击被拦截:元素...在点(1383,73)处不可单击。其他元素将获得点击:...
代码:describe('xyz应用程序成功登录',函数(){
it('Launching Application', function () {
browser.waitForAngularEnabled(false);
var menuButton = element(by.xpath('//span[.="Today"]'));
browser.get('xyz-url')
browser.manage().window().maximize();
console.log('Beta Application launched successfully')
browser.sleep(8000)
menuButton.click();
browser.sleep(2000);
});
})
有几个问题。我通常尝试等待元素被单击或使用javascript单击它。
static readonly EC = protractor.ExpectedConditions;
browser.wait(EC.elementToBeClickable(menuButton);
menuButton.click();
或
browser.executeScript('arguments[0].click();', menuButton);