Can't find an element on iOS in my xamarin ui tests

这一生的挚爱 提交于 2021-01-29 12:41:00

问题


I wrote some tests on android and now I'm trying to make it compatible to iOS too.

I have some picker : enter image description here

I gave the picker automation id and also to the label inside him so I can read it text,

in android I succeed but in iOS I can't even see the label.

tree repl in iOS : Ios repl tree

tree repl in android: android repl tree

the xaml code:

                    <scrControls:ScrPickerWithBorder
                        x:Name="SleepStartPicker"
                        Grid.Row="1"
                        Grid.Column="1"
                        Margin="0"
                        ArrowColor="{StaticResource LableTextColor}"
                        AutomationId="SleepStartPicker"
                        BackgroundColor="{StaticResource EntryBackgoundLite}"
                        BorderColor="#C9D0D5"
                        CornerRadius="5"
                        HeightRequest="50"
                        HorizontalOptions="FillAndExpand"
                        ItemsSource="{Binding SleepStartOptions}"
                        SelectedIndex="{Binding SelectedSleepStartIndex}"
                        TextColor="{StaticResource EntryTextColor}"
                        VerticalOptions="FillAndExpand"
                        TextAutomationId="HouseholdScrStartPickerLabel"/>

why this is happening ? how can I read the label's text ?

来源:https://stackoverflow.com/questions/64552861/cant-find-an-element-on-ios-in-my-xamarin-ui-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!