Xamarin.Forms page with TitleView accessibility on iOS not working

Hello,

I have a ContentPage which uses NavigationPage.TitleView. Everything is working fine except we are not able to perform UI/automated testing on it. We set all the AutomationIds in the XAML and also tried setting AutomationProperties.IsInAccessibleTree in the code behind, but XCode's Accessibility Inspector tool is still unable to detect the content of the titleView.

Here is the XAML for the title view:

<NavigationPage.TitleView>

<StackLayout.Padding>

0,0,15,0

</StackLayout.Padding>

Our goal is to do ui testing using Appium. So far it is working properly on Android. Any help is appreciated.

Thanks,
Wil

Posts

  • Sorry, here is the XAML:

    <NavigationPage.TitleView>
            <StackLayout x:Name ="stackLayout" Orientation="Horizontal">
                <StackLayout.Padding>
                    <OnPlatform x:TypeArguments="Thickness">
                        <On Platform="Android">0,0,15,0</On>
                    </OnPlatform>
                </StackLayout.Padding>
                <Button x:Name ="leftMenu"
                        AutomationId="Id_Home_1"
                        Image="left_menu"
                        BackgroundColor="Transparent"
                        WidthRequest="24"
                        HeightRequest="24"
                        HorizontalOptions="Start"
                        VerticalOptions="Center" />
                <Label Text="{Binding Path=Title, Source={x:Reference profilesPage}}"
                       AutomationId="Id_Home_2"
                       FontFamily="{StaticResource BrandonGrotesque-Regular}"
                       FontSize="20"
                       TextColor="{StaticResource MyVeryDarkGray}"
                       HorizontalTextAlignment="Center"
                       VerticalTextAlignment="Start"
                       HorizontalOptions="CenterAndExpand"
                       VerticalOptions="Center" />
                <Button x:Name="rigthMenu" 
                        AutomationId="Id_Home_3"
                        Image="right_menu"
                        BackgroundColor="Transparent"
                        WidthRequest="24"
                        HeightRequest="24"
                        HorizontalOptions="End"
                        VerticalOptions="Center" />
            </StackLayout>
        </NavigationPage.TitleView>
    
Sign In or Register to comment.