Search code examples
androidxamarin.androidxamarin.uitest

Xamarin.UITest is not able to enter text for Acr.UserDialogs box on Samsung Devices


I am having an issue where both app.ClearText() and app.EnterText() is not working for Acr.UserDialogs box on Samsung Devices (see attached screenshot) however works on Pixel. I am not sure what I can do to work around this, I have already tried to use [![app.Query(e => e.Id("custom").Invoke("setText", string.Empty))][1]][1] and this is not working as well. I have found no way that Xamarin.UITest is able to change the text of these dialog boxes and I am really hoping there is a workaround or something I am missing. Thank you for your help in advance

enter image description here


Solution

  • I was able to repro and test your scenario with the Acr.UserDialogs. App.SetText doesn't work as the item is not focused and as I already figured out, you need to use a query. My query doesn't work because e.Id("custom") is not an EditText element but its container. So modifying query to app.Query(e => e.Id("custom").Descendant().Invoke("setText", string.Empty)) does work.