【发布时间】:2014-04-04 05:35:25
【问题描述】:
以下链接提到我们可以通过提供 id 找到元素...但我无法找到它。
https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/finding-elements.md
按“名称”查找(即文本、标签或开发人员生成的 ID,也就是元素的“accessibilityIdentifier”)
我尝试了以下代码:
WebElement el = driver.findElement(By.name("txtLogin"));
其中 txtLogin 是登录按钮的 ID
它给出了以下异常:
org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
请任何人解释在 appium 中查找元素的所有方法
【问题讨论】: