提问人:chocho 提问时间:11/15/2023 最后编辑:chocho 更新时间:11/20/2023 访问量:46
OpenQA.Selenium.NoSuchElementException: '没有这样的元素: 无法找到元素: {“method”:“css selector”,“selector”:“.body”}
OpenQA.Selenium.NoSuchElementException: 'no such element: Unable to locate element: {"method":"css selector","selector":".body"}
问:
我正在做自动化测试。在这里,我正在测试一个模态。在 Visual Studio 中,它显示错误。我正在使用 C# 编程语言
OpenQA.Selenium.NoSuchElementException: 'no such element: Unable to locate element: {"method":"css selector","selector":".body"}
如何处理这种模式?此模式不会通过按钮触发。触发器是 JavaScript onload,其中模态将在登录后自动显示。
driver.SwitchTo().Frame(driver.FindElement(By.ClassName("body")));
driver.SwitchTo().Frame(driver.FindElement(By.ClassName("modal-open")));
这张图片来自 Inspect Element
答: 暂无答案
评论