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

Asked

Viewed 44 times

1

Can anyone help me with this question? I’m not being able to use the same test code for iOS and Android. The name of the search field 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 I think the generic is the search_src_text, but this one doesn’t work on iOS. Thank you so much.

  • Are you using any specific testing tools? It’s an automated UI test?

1 answer

1

Use the Automationid property, and access the element this way

XAML:

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

Csharp:

app.Query(c=>c.Marked("MeuBotao"))

Browser other questions tagged

You are not signed in. Login or sign up in order to post.