如何使用机器人框架自动化ios app元素?

时间:2017-12-25 00:52:00

标签: ios uitextview robotframework device appium-ios

我们正在尝试使用机器人框架+ appium自动化ios app(在设备上)。下面是页面的xml布局,我们想在输入文本中输入文本。

<AppiumAUT>
<UIAApplication name="mobil88" label="mobil88" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0" x="0" y="0" width="320" height="568">
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0" x="0" y="0" width="320" height="568">
        <UIAScrollView name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1" x="0" y="20" width="320" height="548">
            <UIAWebView name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/0" x="0" y="20" width="320" height="548">
                <UIATextField name="Email" label="" value="Email" dom="[object Object]" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/0/0" x="43" y="219" width="234" height="21">
                </UIATextField>
            </UIAWebView>
        </UIAScrollView>
    </UIAWindow>
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/1" x="0" y="0" width="320" height="568">
    </UIAWindow>
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/2" x="0" y="0" width="320" height="568">
        <UIAStatusBar name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/2/0" x="0" y="0" width="320" height="20">
            <UIAElement name="No Service" label="No Service" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/2/0/0" x="6" y="0" width="62" height="20">
            </UIAElement>
            <UIAElement name="3 of 3 Wi-Fi bars" label="3 of 3 Wi-Fi bars" value="SSID" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/2/0/1" x="73" y="0" width="13" height="20">
            </UIAElement>
            <UIAElement name="2:33 PM" label="2:33 PM" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/2/0/2" x="137" y="0" width="50" height="20">
            </UIAElement>
            <UIAElement name="87% battery power, Charging" label="87% battery power, Charging" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/2/0/3" x="255" y="0" width="60" height="20">
            </UIAElement>
        </UIAStatusBar>
    </UIAWindow>
</UIAApplication>

我们在下面尝试过,但它没有做任何事情或说没有找到该元素,欢迎任何建议。谢谢。

//UIATextField[@name="Email"] ,, or
//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIATextField[1]
xpath=//*[@value="Email"]

0 个答案:

没有答案