【问题标题】:Element <input class="button" type="submit" value="Log In"> is not clickable at point (674, 381)元素 <input class="button" type="submit" value="Log In"> 在点 (674, 381) 不可点击
【发布时间】:2021-11-23 03:02:43
【问题描述】:

HTML:

<input class="button" type="submit" value="Log In">

代码: 这是硒的代码。 WebDriverWait 等待 = new WebDriverWait(驱动程序, 10); WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@value='Log In']"))); driver.findElement(By.xpath("//input[@value='Log In']")).click();

我必须点击这个输入

【问题讨论】:

  • “以 500 毫秒间隔尝试 10 秒”的上下文是什么?我会从标题中移出这段文字,并用问题中的其他信息来澄清它。
  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: selenium selenium-webdriver selenium-chromedriver


【解决方案1】:

你的 xpath 错误

这个

input[@value='Log In']

应该是

//input[@value='Log In']

像这样

WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@value='Log In']")));
driver.findElement(By.xpath("//input[@value='Log In']")).click();

//input 选择document 中的所有input 元素。请阅读它here

【讨论】:

  • 元素 在点 (674, 381) 是不可点击的。其他元素会收到点击:
    ...
    @cruisepandey
  • 这是一个不同的问题,不是您在原始问题中提到的问题,请尝试为新问题提交新票。
猜你喜欢
  • 2021-05-03
  • 2013-09-07
  • 2013-01-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-14
  • 2015-11-14
  • 2010-12-20
相关资源
最近更新 更多