Element.findElement()不适用于使用Appium

时间:2015-08-04 09:14:46

标签: java ios selenium-webdriver appium

我正在尝试在webelement / mobileelement 中找到一个元素,并且它无法使用自动化代码以及Appium Inspector

设定:

  • Appium 1.4.8
  • XCode 6.3.2
  • iOS模拟器:带iOS 8.3的iPhone
  • 应用程序:原生iOS应用程序

尝试定位策略: Xpath,名称,类,ios uiautomation

元素层次结构如图所示: App element hierarchy

我的自动化代码如下:

 WebElement itemElement = driver.findElements(MobileBy.IosUIAutomation("UIATarget.localTarget().frontMostApp().mainWindow().collectionViews()[0].cells().withPredicate(\"name == 'id_itemSummaryView'\")").get(0);//This will return a single element out of 4 elements
 itemElement.findElement(MobileBy.name("id_itemSummaryView")) //throws error

OR

itemElement.findElement(MobileBy.IosUIAutomation("elements()[0]")); //throws error

Appium日志:

info: --> POST /wd/hub/session/31a28dd4-f03f-48eb-a21d-31d991bbd90e/element/33/element {"id":"33","using":"name","value":"id_itemSummaryView"}

info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: "au.getElementByName('id_itemSummaryView', '33')"
info: [debug] Sending command to instruments: au.getElementByName('id_itemSummaryView', '33')

info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":""}
info: [debug] Condition unmet after 85ms. Timing out.
info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":""},"sessionId":"31a28dd4-f03f-48eb-a21d-31d991bbd90e"}

即使是从Appium Inspector,我也设置了#34;从所选元素中搜索"并尝试找到元素。不行。

  • 有没有人在iOS应用程序中找到使用Appium的元素内的元素?
  • 我在这里做错了吗?或者这是Appium中的错误吗?

注意:我还在Appium的github repo上提出了ticket

0 个答案:

没有答案