html - 元素在 Firefox 中不可点击

标签 html css selenium selenium-webdriver selenium-firefoxdriver

我对这种错误有疑问:

元素在点 (791, 394) 处不可单击。其他元素将收到点击: 命令持续时间或超时:66毫秒

谁知道是怎么回事?我正在使用 selenium 网络驱动程序 2.52 和 firefox 版本 43.5

这是部分代码:

private static void waitForLoadingSpinner() throws Exception {
    log("wait for loading spinner");
    Thread.sleep(1000);
    element = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='loadingGlassPane']")));           
    element.click();
    wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[@id='loadingGlassPane']")));

例如,在检查城市后,我的申请按钮不起作用。

enter image description here

enter image description here

最佳答案

尝试使用以下代码。

WebDriverWait wait =new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(By locator)).click();

关于html - 元素在 Firefox 中不可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39659108/

相关文章:

iphone - CSS 背景尺寸在移动设备上损坏

python - WebDriverException : Message: Service chromedriver unexpectedly exited. 状态代码为:127,在 Ubuntu 中使用 ChromeDriver 和 Selenium

javascript - knockout js插入额外的空元素

java - 使用 Selenium 读取表格

python - 在 Robot Framework 中删除字符串的这个 "$ , . "

html - 仅使用带有选中选择器的 HTML/CSS 的交互式选项卡

javascript - 如何在 css 中进行图像颜色混合?

jquery - "Remove"图标和居中对齐 ListView 中的文本通过 css

javascript - 在javascript中从本地存储中检索多个字符串值

.NET:是否有 CSS 媒体类型的系统枚举?