单击模态窗口中的按钮

编程入门 行业动态 更新时间:2024-10-28 14:34:22
本文介绍了单击模态窗口中的按钮 - 量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为现有应用编写量角器测试.我在模态窗口中有一个名为拒绝"的按钮,我正在尝试使用以下方法单击它:

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();

感谢您的帮助:)

更多推荐

单击模态窗口中的按钮

本文发布于:2023-11-22 23:08:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619281.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   按钮   模态   窗口中

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!