ios谓词字符串在appium java-client中使用时找不到确切的单选按钮

时间:2019-01-25 06:50:25

标签: ios appium ui-automation appium-ios

我有一个IOS应用,其中旁边有一个带有静态文本的单选按钮。以下是页面的页面源代码片段。我的目标是在不使用XPATH的情况下单击单选按钮,因为XPATH识别元素的速度确实很慢。

<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" x="20" y="717" width="728" height="41">
                      <XCUIElementTypeOther type="XCUIElementTypeOther" value="0" enabled="true" visible="true" x="50" y="717" width="51" height="41"/>
                      <XCUIElementTypeOther type="XCUIElementTypeOther" name="This Store's Address" label="This Store's Address" enabled="true" visible="true" x="105" y="726" width="165" height="22">
                        <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="This Store's Address" name="This Store's Address" label="This Store's Address" enabled="true" visible="true" x="105" y="726" width="165" height="22"/>
                      </XCUIElementTypeOther>
                    </XCUIElementTypeOther> 

我已经使用ioSNSPredicateString编写了定位器,但是无法单击单选按钮。

  

String clickStoreAddress =“ type =='XCUIElementTypeOther'AND标签   =='此商店的地址'“; appiumDriver.findElement(MobileBy.iOSNsPredicateString(clickStoreAddress))。click();

由于我找不到足够的文档来确定谓词字符串的正确方式,因此需要帮助。

0 个答案:

没有答案