我正在尝试在webelement / mobileelement 中找到一个元素,并且它无法使用自动化代码以及Appium Inspector
设定:
尝试定位策略: Xpath,名称,类,ios uiautomation
我的自动化代码如下:
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;从所选元素中搜索"并尝试找到元素。不行。
注意:我还在Appium的github repo上提出了ticket。