What is the generic name of the Xamarin search field for use in automated testing?

1

Can anyone help me with this? I can not use the same test code for iOS and Android. The search field name that was found is not the same, ie:

Syntax in iOS - app.Query(x => x.Class("UISearchBarTextField"));
Syntax in Android - app.WaitForElement(x => x.Id("search_src_text"));

What looks like the genre is search_src_text , but this does not work on iOS. Thanks again.

    
asked by anonymous 17.02.2017 / 10:40

1 answer

1

Use the AutomationId property, and access the element in this way

XAML:

<Button AutomationId="MeuBotao" Text="Toque aqui" />

CSharp:

app.Query(c=>c.Marked("MeuBotao"))
    
13.03.2017 / 18:59