问题
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