简体   繁体   中英

Appium inspector can't find xpath of date picker in iOS

Hi I am using selenium to try and interact with the date picker of my iOS app. In the appium inspector however I cannot see the xpath or even select the date picker to interact with it.

How can i interact with it. When I click the copy xml and paste it into a browser, I also don't see the date picker in the tree.

在此输入图像描述

EDIT: Adding the xml lines that appear when I do Grid.driver().getPageSource() instead of just copying the xml from Appium...only things I see added onto it are the UIANavigationBar and UIAToolbar

        <UIAApplication name="myApp" label="myApp" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0" x="0" y="0" width="375" height="667">
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0" x="0" y="0" width="375" height="667">
        <UIAStaticText name="Filter By Date" label="Filter By Date" value="Filter By Date" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/0" x="117" y="19.5" width="124.5" height="25">
        </UIAStaticText>
        <UIATableView name="FilterV-TableView-FilterOptions" label="" value="rows 1 to 5 of 5" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1" x="0" y="64" width="375" height="603">
            <UIATableCell name="ActivityVC-TableView-PredefinedFilterItem[0][0]" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/0" x="0" y="27" width="375" height="55">
                <UIAStaticText name="ActivityVC-TableView-PredefinedFilterItem[0][0]" label="Past 90 Days " value="Past 90 Days " dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/1/0/0" x="18" y="45" width="87.5" height="19">
                </UIAStaticText>
            </UIATableCell>
            <UIATableCell name="ActivityVC-TableView-PredefinedFilterItem[0][1]" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/1" x="0" y="82" width="375" height="55">
                <UIAStaticText name="ActivityVC-TableView-PredefinedFilterItem[0][1]" label="September " value="September " dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/1/0" x="18" y="100" width="73" height="19">
                </UIAStaticText>
            </UIATableCell>
            <UIATableCell name="ActivityVC-TableView-PredefinedFilterItem[0][2]" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/2" x="0" y="137" width="375" height="55">
                <UIAStaticText name="ActivityVC-TableView-PredefinedFilterItem[0][2]" label="2015 " value="2015 " dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/2/0" x="18" y="155" width="35.5" height="19">
                </UIAStaticText>
            </UIATableCell>
            <UIATableCell name="ActivityVC-TableView-PredefinedFilterItem[0][3]" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/3" x="0" y="192" width="375" height="55">
                <UIAStaticText name="ActivityVC-TableView-PredefinedFilterItem[0][3]" label="2014 " value="2014 " dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/3/0" x="18" y="210" width="35.5" height="19">
                </UIAStaticText>
            </UIATableCell>
            <UIATableGroup name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/1/4" x="0" y="247" width="375" height="20">
            </UIATableGroup>
            <UIATableCell name="CUSTOM DATE RANGE" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5" x="0" y="267" width="375" height="400">
                <UIAStaticText name="CUSTOM DATE RANGE" label="CUSTOM DATE RANGE" value="CUSTOM DATE RANGE" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5/0" x="19" y="279" width="118" height="15">
                </UIAStaticText>
                <UIAStaticText name="From" label="From" value="From" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5/1" x="18" y="318" width="28" height="15">
                </UIAStaticText>
                <UIAStaticText name="To" label="To" value="To" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5/2" x="193" y="318" width="13" height="15">
                </UIAStaticText>
                <UIAButton name="FilterV-Button-FromDate" label="From" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5/3" x="18" y="333" width="164" height="35">
                </UIAButton>
                <UIAButton name="FilterV-Button-ToDate" label="To" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1/5/4" x="193" y="333" width="164" height="35">
                </UIAButton>
            </UIATableCell>
        </UIATableView>
        <UIAButton name="FilterV-Button-Cancel" label="Cancel" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/2" x="113.5" y="565" width="64" height="64">
        </UIAButton>
        <UIAButton name="FilterV-Button-Done" label="Done" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/3" x="197.5" y="565" width="64" height="64">
        </UIAButton>
        <UIANavigationBar name="myApp.ActivityFilterView" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/4" x="0" y="-44" width="375" height="44">
            <UIAImage name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/4/0" x="0" y="-64" width="375" height="64">
                <UIAImage name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/4/0/0" x="0" y="0" width="375" height="0">
                </UIAImage>
            </UIAImage>
            <UIAButton name="Back" label="Back" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/4/1" x="8" y="-35.5" width="24" height="24">
            </UIAButton>
        </UIANavigationBar>
        <UIAToolbar name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/5" x="0" y="667" width="375" height="44">
            <UIAImage name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/5/0" x="0" y="666.5" width="375" height="0.5">
            </UIAImage>
            <UIAImage name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/0/5/1" x="0" y="667" width="375" height="44">
            </UIAImage>
        </UIAToolbar>
    </UIAWindow>
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/1" x="0" y="0" width="375" height="667">
    </UIAWindow>
    <UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/2" x="0" y="0" width="375" height="667">
        <UIAStatusBar name="" label="" value="" dom="" enabled="true" valid="true" visible="false" hint="" path="/0/2/0" x="0" y="0" width="375" height="20">
            <UIAElement name="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" label="" value="" dom="" enabled="true" valid="true" visible="false" 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="38" height="20">
            </UIAElement>
            <UIAElement name="3 of 3 Wi-Fi bars" label="3 of 3 Wi-Fi bars" value="" dom="" enabled="true" valid="true" visible="false" 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="49" y="0" width="13" height="20">
            </UIAElement>
            <UIAElement name="3:17 PM" label="3:17 PM" value="" dom="" enabled="true" valid="true" visible="false" 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="165" y="0" width="45" height="20">
            </UIAElement>
            <UIAElement name="100% battery power" label="100% battery power" value="" dom="" enabled="true" valid="true" visible="false" 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="345" y="0" width="25" height="20">
            </UIAElement>
        </UIAStatusBar>
    </UIAWindow>
</UIAApplication>

You can interact with it but the problem is only that Appium inspector does not show it. If you print the XML tree got with driver.getPageSource() from your code you can see those elements and use in XPath. At least that is how I solved this problem for my project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM