首页 > 解决方案 > 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>

请帮我解决这个问题。

标签: javascriptautomationpolymerrobotframework

解决方案


ElementClickInterceptedException通常在元素不可“点击”时发生。既然你已经尝试过让睡眠;可以排除同步相关问题。

你可以尝试的是:

  • 检查您的元素所在的任何可能导致此问题的外部容器或框架/iframe

  • 通过 POE(消除过程);确定元素可见的直到什么级别,然后从那里工作 xpath。在示例中,您给出的 div 属性flex layout vertical似乎没有任何值,您可以检查之前和之后是否有某个元素,以查看此 div 的呈现是否存在问题。

  • 从 Polymer 的角度来看,这将有助于检查是否使用了任何影子 DOM 对象;如果是这样,请检查以下内容: https ://github.com/sukgu/shadow-automation-selenium


推荐阅读