The app I have has a XAML for localization.
I'm trying to validate a UILabel that appears in the app and the text would show itself in whatever language the device is set as.
I'm having difficulty accessing the resources due to the TranslationExtension class and interfaces used for both iOS and Android.
I'd like to take the resources' string value according to the device language and compare it to the UILabel that is appearing. Is this possible to do or do UITests in Xamarin only applies to blackbox (only tap, touch, swipes, buttons, text input) interactions?
Answers
Bump
@TiffanyIp You could do an app query and verify the text property
AppResult[] results= app.Query(c => c.Marked("MyUILabelAccessibilityIdentifier"));
then do a foreach
foreach (var item in results ) { item.Text = ... do stuff ... ; }
I would do a backdoor method and return the localized string.
https://developer.xamarin.com/guides/testcloud/uitest/working-with/backdoors/