【发布时间】:2018-07-11 22:26:07
【问题描述】:
我一直在尝试使用 Appium 从 IOS 中单击附加的突出显示(红色箭头)图标,但不断收到超时异常。仅针对表中的“193930 Copy 1”记录需要此单击。有什么帮助吗?
Appium: 1.6.2
XCode: 9.4
Tested in?: Native App
IOS: 11.4
Model: iPhone X
例外:-
org.openqa.selenium.TimeoutException:预期条件失败:等待 By.xpath 定位的元素的可见性:
尝试过的 Xpath 是:-
//XCUIElementTypeStaticText[@name='193930 Copy 1']/XCUIElementTypeButton[contains(@name, 'more')]
(//XCUIElementTypeStaticText[@name='193930 Copy 1'])/following-sibling::XCUIElementTypeButton[@name='more']
//XCUIElementTypeStaticText[@name='193930 Copy 1']/XCUIElementTypeButton[`name == "more"']
//XCUIElementTypeStaticText[contains(@name,'193930 Copy 1')]/following-sibling::XCUIElementTypeButton
//XCUIElementTypeStaticText[contains(@name,'193930 Copy 1')]/XCUIElementTypeButton
【问题讨论】:
-
页面上是否有多个“更多”按钮?
-
是的,表格包含记录列表,并且“更多”按钮与每条记录相关联。
-
您的最后一个定位器在我看来是最正确的。将 xpath 添加到本文的标签列表中,以便对 xpath 更有经验的人可以发表评论并可能提供更好的解决方案。我会为你做,但需要同行的批准,如果你作为原始海报做,它会通过。
标签: appium appium-ios