无法识别IOS中的元素

时间:2018-07-11 12:19:06

标签: appium appium-ios

我一直在尝试使用Appium从IOS单击附件中突出显示的(红色箭头)图标,但一直收到超时异常。仅需要对表中的“ 193930副本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 [包含(@ name,'193930复制1')] / XCUIElementTypeButton

image

1 个答案:

答案 0 :(得分:0)

我试图复制您自己的应用程序中存在的问题,这就是我想出的,它对我有用(请注意,我使用的是Appium版本1.7.1,这可能会影响结果):

//XCUIElementTypeStaticText[@name='193930 Copy 1']/following-sibling::XCUIElementTypeButton

您无需指定下一个元素的名称,因为您可以使用应用程序的结构。我认为尝试中出错的是您组合了错误的属性。