javascript - ElementClickInterceptedException:消息:元素点击被拦截 - 机器人框架
问题描述
我正在使用机器人框架。我对此很陌生。我的应用程序是基于聚合物的应用程序。因为当我单击一个元素时,它显示以下错误,
>ElementClickInterceptedException: Message: element click intercepted: Element <div class="app-block"...</div> is not clickable at point (389, 339).
Other element would receive the click: <vsim-start-page config="{{config}}" startpage="[[startpage]]" vertical="" layout=""></vsim-start-page>
下面的事情,我已经尝试过了,但找不到合适的解决方案。
1. Sleep for few seconds
2. CLick Elment At coordinates - Working but not a good solution
3. Execute JavaScript document.evaluate("//*[@name='apps']/div[2]/div/div/div/div/div[3]/div",document.body,null,9,null).singleNodeValue.click();
4. Execute JavaScript document.evaluate("//div[contains(text(),'Parts Summary
New')]",document.body,null,9,null).singleNodeValue.click();
下面是元素的源代码,
<div flex layout vertical>
<div class="app-title" style="font-size:0.8em;text-transform: uppercase;">Pallet Register</div>
<div class="app-subtitle">Pallet Register View</div>
请帮我解决这个问题。
解决方案
ElementClickInterceptedException
通常在元素不可“点击”时发生。既然你已经尝试过让睡眠;可以排除同步相关问题。
你可以尝试的是:
检查您的元素所在的任何可能导致此问题的外部容器或框架/iframe
通过 POE(消除过程);确定元素可见的直到什么级别,然后从那里工作 xpath。在示例中,您给出的 div 属性
flex layout vertical
似乎没有任何值,您可以检查之前和之后是否有某个元素,以查看此 div 的呈现是否存在问题。从 Polymer 的角度来看,这将有助于检查是否使用了任何影子 DOM 对象;如果是这样,请检查以下内容: https ://github.com/sukgu/shadow-automation-selenium
推荐阅读
- android - Supernova Emoji 库与 Android 中的 socket.io 聊天应用程序集成
- javascript - 每次向 DOM 中添加不同坐标的元素
- animation - Flare 画板项目需要时间在 Flare 角色上渲染
- devexpress - 如何设置 columnOption 循环抛出所有列?
- javascript - 是否有任何 JS 方法仅通过提供月份和年份作为参数来解析日期?
- postgresql - 使用 go-gorm 编写的数据库查询执行更新时,Postgres 数据库中的值“0”(零)未得到更新
- c++ - 使用 QTCreator 集成和运行 OpenDDS
- ios - 在 mac os 中显示带有 MBProgressHUD 的 toast 消息
- android - AutoFitTextureView 捕获的帧在相机预览中不可见
- java - 选择一个文件,通读它,并将其内容附加到 2 个链表