当前位置: 首页 > 知识库问答 >
问题:

Selenium等待可单击-元素单击截获问题

鱼志诚
2023-03-14
Sun Oct 27 14:03:53 IST 2019:INFO: WebDriver: Click on [[ChromeDriver: chrome on XP (bf4a41cbd3e7f6cfedb2f70301ed0512)] -> id: header-account]
Sun Oct 27 14:03:53 IST 2019:ERROR: element click intercepted: Element <button _ngcontent-egd-c11="" class="avatar-style ant-btn ant-btn-default ant-btn-circle" id="header-account" nz-button="" nz-popover="" nzplacement="bottomRight" nzshape="circle" nztrigger="click" ng-reflect-nz-shape="circle" ng-reflect-nz-content="[object Object]" ng-reflect-nz-trigger="click" ng-reflect-nz-placement="bottomRight" ng-reflect-directive-name-title="" nz-wave="[object Object]">...</button> is not clickable at point (1888, 31). Other element would receive the click: <path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
  (Session info: chrome=78.0.3904.70)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'PC', ip: '10.3.3', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.70, chrome: {chromedriverVersion: 77.0.3865.40 (f484704e052e0..., userDataDir: C:\Users\Sagi\AppData\Local...}, goog:chromeOptions: {debuggerAddress: localhost:56066}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: bf4a41cbd3e7f6cfedb2f70301ed0512
Other element would receive the click: <path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>

共有1个答案

云京
2023-03-14
WebElement element = driver.findElement(By.id("header-account"));
Actions actions = new Actions(driver);
actions.moveToElement(element).click().build().perform();
WebElement myelement = driver.findElement(By.id("header-account"));
JavascriptExecutor jse2 = (JavascriptExecutor)driver;
jse2.executeScript("arguments[0].scrollIntoView()", myelement); 
 类似资料:
  • 我将测试一个网络应用程序。在我的表中有一个按钮可以选择所有条目。我尝试过: selenium单击按钮,但什么也没发生。(还有send_Keys(Keys.Return))应用程序是用GXT开发的,我发现按钮后面有很多javascript。是否有可能等待事件加载器准备就绪?在单击之前等待可以解决问题,但不是自动测试的解决方案。

  • 我有一个问题,硒,测试网站。 我试图等待元素被点击,它通过了。这是我的代码: 这是例外: > 我也试着让硒按下esc按钮,但仍然是错误,我如何克服这个问题? 我如何知道在哪里单击该元素将可以自由单击我需要他单击的位置这不是等待问题,因为当我调试时,我等待了更多次,仍然会出现此错误 当做

  • 我被困在一个有硒等待的情况下。我正在使用硒爪哇和cucumber。点击一个按钮,一个新的页面加载,但内容还不能点击。当页面加载到背面时,将显示一个灰色屏幕阻止器,以便在加载整个页面之前使其不可编辑。所以我不能使用waitforpageload或wait for element使其可见,因为它们都返回true,因为元素在后台可用。我尝试使用一个条件来检查元素是否可点击,以确保页面完全加载。但那也没用

  • 当我点击一个按钮时,它会显示一个带有另一个按钮的表单,我想点击其中一个。这是一个视频(非常短),请观看http://screencast.com/t/zyliSemW1s1 所以我点击“买票”按钮,简单如下: 然后我等待下一个按钮被点击。 我使用下一个代码: 之后,我点击我等待的按钮: 我得到错误:元素在这一点上是不可点击的。 据我所知,该方法预期的条件。ElementToBeClickable(

  • 问题内容: 我目前正在从事一个自动填写表格的项目。填写表单后,出现下一个按钮,这就是为什么它给我一个错误。 我努力了: HTML: 错误: selenium.common.exceptions.ElementClickInterceptedException:消息:元素单击被拦截:元素在点(203,530)不可单击。其他元素将获得点击:…(会话信息:chrome = 76.0.3809.132)

  • 问题内容: 我试图单击“所有主题”和“所有状态”复选框,然后搜索结果。当我运行脚本时,会打开一个Chrome窗口,大小为1036x674。 如果我不理会窗口,则会出现元素点击拦截错误。如果我最小化或最大化窗口,则脚本可以正常工作。 我正在使用Selenium 3.141.0,chrome 76,chromedriver 76和python 3.6 但是我得到这个错误: ElementClickIn