【发布时间】:2018-06-12 09:05:37
【问题描述】:
<button class="add-school btnEditDashboard btn btn-primary pull-right" ng-click="CreateNewSchool()" name="AddSchool" type="submit">Add School</button>
也试过 xpath。 (\\html/body/div[2]/div/div[2]/div/div/div[1]/div/div[2]/button)
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"tag name","selector":"AddSchool"}
【问题讨论】:
-
您的实际问题是什么?您尝试 Xpath 的 HTML 代码是什么样的?
-
我猜,您正在尝试使用带有值 addschool 的标签名称来查找元素。你必须使用正确的方法。
-
请检查是否在iframe中?
-
很好,先生,它与 iframe 焦点一起工作
标签: java selenium selenium-webdriver xpath webdriver