【发布时间】:2020-12-31 05:27:11
【问题描述】:
我尝试通过 cssSelector 和 xPath 找到它,但仍然显示 NoSuchElementException
WebElement element = driver.findElement(By.cssSelector("button[class='btn btn-primary c-schedule-story-button ']"));
element.click();
【问题讨论】:
-
@tgdavies 这是一个有效的 CSS 选择器,他们只是不使用 .用于类并使用“类”作为属性链接到 Web 元素
标签: java selenium xpath automation nosuchelementexception