microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 225 forks source link

Issue with app.EnterText for Android API 29 ONLY Xamarin.UITest #1451

Closed Moshex closed 1 year ago

Moshex commented 4 years ago

I have been having an issue with Xamarin.UITest after the application that I am working on was updated to the latest android version (API 29). This issue did not happen before the application updates and automation worked as intended on API 29. Before the application was updated and you did a fresh install the application would have an "OS" prompt stating that the "Application was out of Date" once the application was updated that prompt no longer displayed however the Xamarin.UITest issues appeared.

The issue is that when automation runs on a device with API 29 ONLY and when the code app.EnterText runs the text that was requested via code to be inputted does not get input. The same applies to app.ClearText, once the command is done the text in the field does not get cleared. its as if there is a permission issue with the automation interacting with the application text fields only. Note, the test does not fail with an error and the test keeps running like it did the commend, which makes it header to know why it's doing this.

I did work with my DEV's to see if this is an application issue and his theory is that it's a permission issue but we are both not sure where the issue is of what permission is being blocked any help of shedding light would be very helpful.

Environment replication that I am seeing the issues on: Device/OS: Pixel 3 XL (real device)/ Android version 10(API 29) Xamarin.UITest version: 3.0.4

Application: Rinning the latest updates for packages including Xamrin.Forms and the application is configured for API(29) Note: the text fields work just fine outside of automation and if a user inputs the text it works as intended, just an Automation issue

VS/Xcode version: Visual Studio Enterprise 2019 for Mac Version 8.3.10 (build 2) Installation UUID: 87bfc8d6-bb7e-4416-8725-c451ad424835 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)

Package version: 604000208 Mono Framework MDK Runtime: Mono 6.4.0.208 (2019-06/07c23f2ca43) (64-bit) Package version: 604000208

NuGet Version: 5.3.0.6192

.NET Core SDK SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks SDK Versions: 3.0.100 2.1.700 2.1.505 2.1.504 2.1.503 2.1.302 2.1.301 2.1.4 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks

.NET Core Runtime Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 3.0.0 2.1.13 2.1.11 2.1.9 2.1.8 2.1.7 2.1.2 2.1.1 2.0.5

Xamarin.Profiler Version: 1.6.12.29 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater Version: 11

Apple Developer Tools Xcode 11.2.1 (15526.1) Build 11B500

Xamarin Designer Version: 16.3.0.256 Hash: 8a223bfd7 Branch: remotes/origin/d16-3 Build date: 2019-11-01 21:02:02 UTC

Xamarin.Mac Version: 6.6.0.12 (Visual Studio Enterprise) Hash: e3c2b406d Branch: xcode11.2 Build date: 2019-11-01 00:12:07-0400

Xamarin.iOS Version: 13.6.0.12 (Visual Studio Enterprise) Hash: e3c2b406d Branch: xcode11.2 Build date: 2019-11-01 00:12:08-0400

Xamarin.Android Version: 10.0.6.2 (Visual Studio Enterprise) Commit: xamarin-android/d16-3/c407838 Android SDK: /Users/{*}/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 5.0 (API level 21) 5.1 (API level 22) 6.0 (API level 23) 7.0 (API level 24) 7.1 (API level 25) 8.0 (API level 26) 8.1 (API level 27)

SDK Tools Version: 26.1.1 SDK Platform Tools Version: 29.0.5 SDK Build Tools Version: 28.0.3

Build Information: Mono: mono/mono/2019-06@476d72b9e32 Java.Interop: xamarin/java.interop/d16-3@5836f58 LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94 LibZip: nih-at/libzip/rel-1-5-1@b95cf3fd ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.27.1@8212a2d Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

Microsoft Mobile OpenJDK Java SDK: /Users/mmoadeb/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager Version: 1.4.0.65 Hash: c33b107 Branch: remotes/origin/d16-3 Build date: 2019-11-19 20:33:22 UTC

Android Device Manager Version: 1.2.0.116 Hash: d2b2af0 Branch: remotes/origin/d16-3 Build date: 2019-11-19 20:33:42 UTC

Xamarin Inspector Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1

Build Information Release ID: 803100002 Git revision: add3a4998a5cb5b081e0404e1fe13acfecb7801d Build date: 2019-11-20 13:35:15+00 Build branch: release-8.3 Xamarin extensions: 79c69708816813b498283eeda7bcb4d464433a04

Operating System Mac OS X 10.15.1 Darwin 19.0.0 Darwin Kernel Version 19.0.0 Thu Oct 17 16:17:15 PDT 2019 root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64

Enabled user installed extensions Straight8's SpecFlow Integration 1.11.3.0 XAML Styler 1.1.5

The only error that I see when debugging the test is below, I am not sure if this has any relevance:

[0x7000100bc000] The instruction pointer of the currently executing method(Xamarin.UITest.Queries.AppQuery:tokensFromObjectArray (object[])) is not on the recorded stack. This is likely due to a runtime bug. The 15 frames are as follow: [0x7000100bc000] Frame (0 / 15): (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo:InternalInvoke (System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) [0x7000100bc000] Frame (1 / 15): System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x7000100bc000] Frame (2 / 15): System.Reflection.MethodBase:Invoke (object,object[]) [0x7000100bc000] Frame (3 / 15): System.Delegate:DynamicInvokeImpl (object[]) [0x7000100bc000] Frame (4 / 15): System.MulticastDelegate:DynamicInvokeImpl (object[]) [0x7000100bc000] Frame (5 / 15): System.Delegate:DynamicInvoke (object[]) [0x7000100bc000] Frame (6 / 15): TechTalk.SpecFlow.Bindings.BindingInvoker:InvokeBinding (TechTalk.SpecFlow.Bindings.IBinding,TechTalk.SpecFlow.Infrastructure.IContextManager,object[],TechTalk.SpecFlow.Tracing.ITestTracer,System.TimeSpan&) [0x7000100bc000] Frame (7 / 15): TechTalk.SpecFlow.Infrastructure.TestExecutionEngine:ExecuteStepMatch (TechTalk.SpecFlow.Bindings.BindingMatch,object[]) [0x7000100bc000] Frame (8 / 15): TechTalk.SpecFlow.Infrastructure.TestExecutionEngine:ExecuteStep (TechTalk.SpecFlow.Infrastructure.IContextManager,TechTalk.SpecFlow.Bindings.StepInstance) [0x7000100bc000] Frame (9 / 15): TechTalk.SpecFlow.Infrastructure.TestExecutionEngine:Step (TechTalk.SpecFlow.Bindings.StepDefinitionKeyword,string,string,string,TechTalk.SpecFlow.Table) [0x7000100bc000] Frame (10 / 15): TechTalk.SpecFlow.TestRunner:When (string,string,TechTalk.SpecFlow.Table,string) [0x7000100bc000] Frame (11 / 15): TechTalk.SpecFlow.Steps:When (string,string,TechTalk.SpecFlow.Table) [0x7000100bc000] Frame (12 / 15): TechTalk.SpecFlow.Steps:When (string) [0x7000100bc000] Frame (13 / 15): WellRx.UITests.Steps.DashboardSteps:GivenIAmOnTheHomePage () [0x7000100bc000] Frame (14 / 15): (wrapper dynamic-method) object:lambda_method (System.Runtime.CompilerServices.Closure,TechTalk.SpecFlow.Infrastructure.IContextManager)

Oddj0b commented 4 years ago

Thank you for reporting the bug with so much detail. I've created a bug for it.

quangthaiaht commented 4 years ago

Hi @Moshex I have a same issue , so if you have any solution,please share me Thanks you

Moshex commented 4 years ago

Hi @Moshex I have a same issue , so if you have any solution, please share me Thanks you

I do not have a solution yet but based on what it stated it sounds like it is a bug with Xamrain uiTest and they need to fix it in a future release.

quangthaiaht commented 4 years ago

Hi @Moshex so when you have solutions, can you post them to here? thanks you

Moshex commented 4 years ago

Hi @Moshex so when you have solutions, can you post them to here? thank you

@quangthaiaht I will if I do, but as I stated this does not appear to be something that can not be fixed in code since it's an issue in the framework itself

quangthaiaht commented 4 years ago

@Moshex i tried with a other app on android 10 devices then app.EnterText is still works. what do you think this issus.I thinks team dev customized object edittext, and it suits earlier android versions but it not suites with android 10

TheWraithL98 commented 4 years ago

I'm the developer working with @Moshex - We did have a few minor customizations (for UI) with our Entry controls, so I removed all of them in a test branch - I stripped the entire page down to just a scrollview wrapping a stacklayout with 2 Entries and a few buttons on it - completely unstyled, unaltered.

@Moshex ran his automation tests again and had the exact same result. It will definitely take me some time, since I'm in the middle of a release, but I will do my best to make a reproduction solution. If someone has a sample app that is working, please provide that too, so we can analyze that.

quangthaiaht commented 4 years ago

i have a app, which is prove app.Entertext work on android 10 devices You can see it at the link https://github.com/quangthaiaht/test If you encounter any difficulties, please add skype +841679099444 which is my phone number used to create skype nick Thanks you

Moshex commented 4 years ago

@quangthaiaht The app you linked us is just an APK, we need the application's full source code in order to know that the application has the same updates and packages that the application I am working on. As stated in the bug even my app used to work on API 29 but it stopped working after updating the application to be configured for the newest Android update, AKA API 29. Do you have a true sample application that is updated with the latest updates and the source code, not just an APK? This is so if it does work we are able to see the differences and fix our application accordingly.

quangthaiaht commented 4 years ago

I can not public source code the project but i realy with the file apk then app.Entertext work on android 10 devices

Moshex commented 4 years ago

@quangthaiaht But the question of whether or not the APK that you have provided matches the preconditions for the bug that we are dealing with. This makes it not useful into tracking down what the issue is stemming from. Thank you for trying and track this down.

bruno-garcia commented 4 years ago

I have a repro here: https://github.com/getsentry/symbol-collector/pull/63

Basically ClearText focuses on the element but doesn't clear the text box. EnterText doesn't write the text but focuses too.

I've tested on a Samsung S10+ device.

curia-damiano commented 4 years ago

Hi, I have faced the exact same problem: updated an existing app to API 29, and both ClearText and EnterText fail both on local connected physical device, and emulators in App Center. Waiting for a fix, I can provide a repro project and related UI tests if needed.

bruno-garcia commented 4 years ago

@Oddj0b

Thank you for reporting the bug with so much detail. I've created a bug for it.

Is this bug filed on GitHub? Is there a way for us to follow the progress?

KonstantinKellermann commented 4 years ago

I have the same issue on my Pixel (3a xl - Android 10).

Target Android Version: Android 10.0 (API Level 29 - Q).

All of my tests were able to run successfully with an earlier version.

On my Samsung S9 (Android 9) the isssue is not there.

After I set the Target Android Version to 9 EnterText works fine on both devices.

Oddj0b commented 4 years ago

@bruno-garcia It's tracked internally.

yurii-harkusha commented 4 years ago

@Oddj0b is there any news about this bug? Is ETA for it?

lllaurensss commented 4 years ago

Any updates on this? I have the same problem enter en clear text not working on a samsung with android version 10. On my huawei with android version 9 I have no problems. However when I enter text with the adb command it works without any problem.

yurii-harkusha commented 4 years ago

Any updates on this? I have the same problem enter en clear text not working on a samsung with android version 10. On my huawei with android version 9 I have no problems. However when I enter text with the adb command it works without any problem.

I have the same issue with Samsung Galaxy S9 (Android 10).

seanrodda commented 4 years ago

I am also having this issue with UITests in App Center. This basically renders UI testing of Android apps that have text fields (such as login) useless. Is there any work around?

curia-damiano commented 4 years ago

You could introduce backdoors to replace your login process, see here: https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/working-with-backdoors

The point is that if after the login there is another text-box, you'll face again the problem.

The only other solution is that this bug gets fixed.

seanrodda commented 4 years ago

@curia-damiano Thanks, yes I am currently using backdoors at the moment to simulate picking images, however if I have to use backdoors for every text box, the gets a bit cumbersome, as well as remove part of the reason UI tests exists, to test UI elements, such as text boxes. Thanks for your suggestion :)

Does anyone know who the Microsoft representative is on this ticket, if there is one?

berengere13 commented 4 years ago

I have the same problem. Even with the repl I can not enterText in Entry.

Do you notify Xamarin.UITest repository ?

seanrodda commented 4 years ago

I couldn’t find a Xamarin.UITest repository. I also raised a support ticket with App Center, and was told to just “thumbs up” 👍 this issue, so that it gets higher prioritised by the team.

King-of-Spades commented 4 years ago

Internal Tracking ID - AZD 72482

jeromelaban commented 4 years ago

The latest release 3.0.8-dev1 does not fix the issue. Are there any kind of clues on why this does not work ? I can provide another type of repro using Uno Platform, if that helps.

bruno-garcia commented 4 years ago

@jeromelaban Sadly even with many repros, this issue has been ignored by appcenter folks for months. I've also brought this up on the Xamarin slack server, appcenter channel without reply. I'll reach out through zendesk.

bruno-garcia commented 4 years ago

I have received updated info that it is at the top of the ready to work list..

Our engineers are working on it but but we don't have an estimate on a fix right now. We will let you know once the fix is in place. We are sorry for the inconvenience.

jbachelor commented 4 years ago

Just discovered this issue today: I have been using an Android Pixel 3a running api 29 for UI tests in App Center, but locally I run UI tests on a physical LG V20 running api 26. I added a test today that needs to enter text in an entry and an editor field, and sure enough, no text gets entered if the Android device is running api 29.

I've confirmed that the issue happens on a local emulator as well, and I have also confirmed that the issue is not there if you use an emulator running api 28.

As a work-around until this issue is resolved, I will be creating a new device-set in App Center with an Android device running api 28 rather than 29. Hopefully something like this will get most people by until the real issue is resolved.

denis-reichelt commented 4 years ago

Same problem here. I recognized a java.lang.NoSuchFieldException in the logcat during my UITest where entering text failed. Maybe this is a hint for the guys who are about to fix that issue:

 I System.out: URI: /
 I System.out: params: {json={"command":"keyboard_enter_text","arguments":["Hallo"]}
 I System.out: }
 I System.out: header: {content-type=application/json; charset=utf-8, connection=Keep-Alive, expect=100-continue, host=127.0.0.1:53445, content-length=55}
 I System.out: params: {json={"command":"keyboard_enter_text","arguments":["Hallo"]}
 I System.out: }
 I System.out: ProP json = {"command":"keyboard_enter_text","arguments":["Hallo"]}
 I System.out: files: {}
 I System.out: command: {"command":"keyboard_enter_text","arguments":["Hallo"]}
 I InstrumentationBackend: Got command:'Command:'Line:null,keyboard_enter_text', arguments:'[Hallo]'
 W f.tgm.ticketap: Accessing hidden field Landroid/view/inputmethod/InputMethodManager;->mServedView:Landroid/view/View; (greylist-max-p, reflection, denied)
 W System.err: java.lang.RuntimeException: sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil$UnexpectedInputMethodManagerStructureException: java.lang.NoSuchFieldException: No field mServedView in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.text.TextAction.execute(TextAction.java:44)
 W System.err: <09>at sh.calaba.instrumentationbackend.Command.execute(Command.java:47)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.HttpServer.runCommand(HttpServer.java:787)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.HttpServer.serve(HttpServer.java:767)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:487)
 W System.err: <09>at java.lang.Thread.run(Thread.java:919)
 W System.err: Caused by: sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil$UnexpectedInputMethodManagerStructureException: java.lang.NoSuchFieldException: No field mServedView in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil.getServedView(InfoMethodUtil.java:29)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.text.TextAction.execute(TextAction.java:28)
 W System.err: <09>... 5 more
 W System.err: Caused by: java.lang.NoSuchFieldException: No field mServedView in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)
 W System.err: <09>at java.lang.Class.getDeclaredField(Native Method)
 W System.err: <09>at sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil.getServedView(InfoMethodUtil.java:22)
 W System.err: <09>... 6 more
 I System.out: result:{ "bonusInformation":[ "Exception stack trace:\n java.lang.RuntimeException: sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil$UnexpectedInputMethodManagerStructureException: java.lang.NoSuchFieldException: No field mServedView in class Lan
droid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)\n
\tat sh.calaba.instrumentationbackend.actions.text.TextAction.execute(TextAction.java:44)\n\tat sh.calaba.instrumentationbackend.Command.
execute(Command.java:47)\n\tat sh.calaba.instrumentationbackend.actions.HttpServer.runCommand(HttpServer.java:787)\n\tat sh.calaba.instrumentationbackend.actions.HttpServer.serve(HttpServer.java:767)\n\tat sh.calaba.instrumentationbackend.actions.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:487)\n\tat j
ava.lang.Thread.run(Thread.java:919)\nCaused by: sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil$UnexpectedInputMethodManagerStructureException: java.lang.NoSuchFieldException: No field mServedView in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inpu
tmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)\n\tat sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil.getServedView(InfoMethodUtil.java:29)\n\tat sh.calaba.instrumentationbackend.actions.text.TextAction.execute(TextAction.java:28)\n\t... 5 more\nCaus
ed by: java.lang.NoSuchFieldException: No field mServedView in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)\n\tat java.lang.Class.getDeclaredField(Native Method)\n\tat sh.cal
aba.instrumentationbackend.actions.text.InfoMethodUtil.getServedView(InfoMethodUtil.java:22)\n\t... 6 more\n"
],
"message":"sh.calaba.instrumentationbackend.actions.text.InfoMethodUtil$UnexpectedInputMethodManagerStructureException: java.lang.NoSuchFieldException: No field mServedView in class Landroi
d/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes3.dex)",
"success":false
}
michaelulmer commented 4 years ago

EnterText works on API28 EnterText doesn't work on API29 Downgrade to API28 is my workaround.

When you are testing locally with a emulator you should have no issues downgrading. When you use a physical device that is upgraded to API29 you have a problem. I'm not sure about Cloud-Test, can you choose the API level of the devices there?

jbachelor commented 4 years ago

Yes, @michaelulmer - You can create basically any kind of device you want. Here's a screenshot of my "device sets" in app center. You can see my two sets (each 'set' includes just one device in this case) here... An Pixel 3a running Android 10 was my initial device, which shows the problem. The second device you see is my newer device set, with a Pixel 3a running Android 9, which does not have the enter-text problem:

image

CorentinRobertSmood commented 4 years ago

Hello, I search any solutions about this issue, have you receive an update about this ?

vikasagarwal3399 commented 4 years ago

Hi Guys, I applied in app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); way for andriod API 29. It's work for me.

CorentinRobertSmood commented 4 years ago

Ok it's work but it's not good way to do. So I think we must use the method clearText and enterText. Thanks you

CorentinRobertSmood commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter().

I'm waiting the fix for use app.EnterText with android api 29.

AdamDiament commented 4 years ago

I have the same issue. Xamarin guys - any update as to a fix? All my user interface unit tests on android 10 are not working right now.

curia-damiano commented 4 years ago

+1

pulanekumalo commented 4 years ago

Any feedback on this ????https://forums.xamarin.com/discussion/comment/415835#Comment_415835

sasivishnu commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter().

I'm waiting the fix for use app.EnterText with android api 29.

Hi @CorentinRobertSmood can you give sample how you fixed it? Its not working still in searchbar. I am unable to enter any text in searchBar

Moshex commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter(). I'm waiting the fix for use app.EnterText with android api 29.

Hi @CorentinRobertSmood can you give sample how you fixed it? Its not working still in searchbar. I am unable to enter any text in searchBar

I don't think the solution posted there is a true solution, at the end of the day we really just need the bug to be fixed.

IeuanWalker commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter(). I'm waiting the fix for use app.EnterText with android api 29.

Hi @CorentinRobertSmood can you give sample how you fixed it? Its not working still in searchbar. I am unable to enter any text in searchBar

I don't think the solution posted there is a true solution, at the end of the day we really just need the bug to be fixed.

Agreed, part of our UI testing is testing different android versions, and at the moment Android 10 is untestable with this bug.

sasivishnu commented 4 years ago

Agreed, Its been more than 6 months since bug is reported and acknowledged. Not sure what's the plan from Xamarin.UITest team apart from May month update that "they are working on fix". Please do let us know any update guys. Thanks

CorentinRobertSmood commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter(). I'm waiting the fix for use app.EnterText with android api 29.

Hi @CorentinRobertSmood can you give sample how you fixed it? Its not working still in searchbar. I am unable to enter any text in searchBar

I'm sorry for time to my response, in your searchbar you can add method SearchButtonPressed="SearchBar_OnSearchButtonPressed" and when you press enter you can invoke this method

CorentinRobertSmood commented 4 years ago

[Update] in search Bar with app.Query(e => e.Marked("lblUsername").Invoke("setText", "username")); the event on text changed is not working. [UPDATE] I Found solution with app.PressedEnter(). I'm waiting the fix for use app.EnterText with android api 29.

Hi @CorentinRobertSmood can you give sample how you fixed it? Its not working still in searchbar. I am unable to enter any text in searchBar

I don't think the solution posted there is a true solution, at the end of the day we really just need the bug to be fixed.

I agree but if you need UI tests you must make UI Test works on iOS and Android, and i search any solutions for by pass this bug.

CorentinRobertSmood commented 4 years ago

Agreed, Its been more than 6 months since bug is reported and acknowledged. Not sure what's the plan from Xamarin.UITest team apart from May month update that "they are working on fix". Please do let us know any update guys. Thanks

I hope seriously the bug will fix ! it's too bad it's works in API 28 and not for 29 and 30 ...

hmihaylov commented 4 years ago

I have no idea why the issue in Xamarin UITest (Xamarin.Forms - https://github.com/xamarin/Xamarin.Forms/issues/11356) was closed and this one was left open. The bug is not related to appcenter but is a general Xamarin UITest issue. This is basic functionality that is not working for 8 months since reported!

curia-damiano commented 4 years ago

The other issue has been open under Xamarin.Forms, but Xamarin.UITest is not part of Forms

ernestoyaquello commented 4 years ago

Any news on this? This is very basic functionality and it would be good to have it working without ugly workarounds.

joshardt commented 4 years ago

This workaround fixed it for me:

private void EnterTextInEntry(string text)
{
    if (OnAndroid)
    {
        app.Query(x => x.Marked("YourAutomationId").Invoke("setText", text));
    }
    else
    {
        app.EnterText(text);
    }
}