Java Appium inspector在iOS中找不到日期选择器的xpath

Java Appium inspector在iOS中找不到日期选择器的xpath,java,ios,selenium,selenium-webdriver,appium,Java,Ios,Selenium,Selenium Webdriver,Appium,您好,我正在使用selenium尝试与iOS应用程序的日期选择器进行交互。然而,在appium检查器中,我看不到xpath,甚至无法选择与之交互的日期选择器 我如何与它互动。当我单击复制xml并将其粘贴到浏览器中时,我也看不到树中的日期选择器 编辑:添加执行Grid.driver.getPageSource时显示的xml行,而不是从Appium复制xml…我看到添加到其中的只有UIANavigationBar和UIAToolbar <UIAApplication name=

您好,我正在使用selenium尝试与iOS应用程序的日期选择器进行交互。然而,在appium检查器中,我看不到xpath,甚至无法选择与之交互的日期选择器

我如何与它互动。当我单击复制xml并将其粘贴到浏览器中时,我也看不到树中的日期选择器

编辑:添加执行Grid.driver.getPageSource时显示的xml行,而不是从Appium复制xml…我看到添加到其中的只有UIANavigationBar和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>

您可以与它交互,但问题只是Appium inspector没有显示它。如果打印从代码中使用driver.getPageSource获得的XML树,您可以看到这些元素并在XPath中使用。
至少这就是我为我的项目解决这个问题的方法。

我已经这样做了,appium生成的xml和我从代码中打印出来的xml之间的唯一区别就是我在上面的问题中添加了什么。我不认为这些代表日期选择器…请纠正我的错误,尽管这是一个奇怪的实现。在我的项目中,每个日期字段元素都有UIAPickerWheel元素,通过发送文本,我可以像在文本字段中一样设置值。但是FilterV Button FromDate是一个按钮,而不是文本字段?我不知道你能不能打成中文?