c# - 仅在一台 PC 中因单击拦截而导致测试失败
问题描述
我指的测试在我的 PC 上是可以的,但是当我的同事尝试运行它时,她收到以下消息:
Test method EVO4.Apresentacao.Angular.Teste.Brasil.Modulos.Geral.Menus.AdministrativoContratos threw exception:
OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <a href="#tabs-log" id="btnLog" class="ui-tabs-anchor" role="presentation" tabindex="-1">...</a> is not clickable at point (342, 113). Other element would receive the click: <div style="position: relative;" class="row-fluid">...</div>
(Session info: chrome=88.0.4324.104)
代码行是:
Driver.FindElement(By.Id("btnLog")).Click();
该按钮的 HTML 是:
<li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="tabs-log" aria-labelledby="btnLog" aria-selected="false"><a href="#tabs-log" id="btnLog" class="ui-tabs-anchor" role="presentation" tabindex="-1">Histórico</a>
<a href="#tabs-log" id="btnLog" class="ui-tabs-anchor" role="presentation" tabindex="-1">Histórico</a>
</li>
当它应该被点击时,元素在她的屏幕上可见,但它与我的屏幕处于不同的位置,因为 selenium 正在按 Id 搜索,这对我来说没有任何意义。
为什么这不会发生在我身上,我该如何解决这个问题?
解决方案
推荐阅读
- html - Google Material Design 是否支持 RTL 布局?
- shell - 无法在 unix 中的 if else 语句中比较字符串
- docker - 为什么我在运行 docker 映像时一直在 localhost 上看到 nginx index.html
- python - 使用 Tkinter 添加标准对象作为 Frame 类属性
- c# - 如何在 NUnit 中使用自定义 CultureInfo?
- mysql - 如何在mysql中检查日期是否在该月的10号之前?
- hadoop - 在 Oozie EMR 中安装 ExtJS
- swift - 我需要帮助 Swift 的功能
- python - python parquet install 在 macos 上使用 snappy 和 thiftpy 失败
- java - 释放
在 JNI 调用期间,ArrayElements 实际上没有从堆中释放内存?