本文介绍了单击模态窗口中的按钮 - 量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为现有应用编写量角器测试.我在模态窗口中有一个名为拒绝"的按钮,我正在尝试使用以下方法单击它:
I'm writing protractor tests for an existing app. I have a button called 'Decline' in a modal window, and I'm trying to click it using:
element(by.buttonText('Decline')).click();但我收到以下错误:
UnknownError: unknown error: Element is not clickable at point (,). Other element would receive the click:可能是因为我在模态窗口外有另一个名为拒绝"的按钮?
May be because I have another button called 'Decline' outside the modal window?
如何点击模态窗口的拒绝按钮?
How do I click on the modal window's Decline button ?
发现这是显示这个Decline按钮的js代码.
Found that this is the js code that displays this Decline button.
..... var content = { title: 'Decline', htmlBody: '<p>...</p> ', okButton: 'Decline', onOk: function() { ..... 推荐答案我的同事推荐了这个并且它奏效了:
My Colleague recommended this and it worked:
点击 First Decline 按钮会打开一个模式,
Clicking on First Decline button opens up a modal,
睡一会儿,
现在点击第二个拒绝按钮.
Now click on the second Decline button.
element(by.buttonText('Decline')).click(); browser.sleep(2000); element(by.cssContainingText('.btn', 'Decline')).click();感谢您的帮助:)
更多推荐
单击模态窗口中的按钮
发布评论