EnterText not working on iOS simulator (soft keyboard not connecting)

LyndonHugheyLyndonHughey USUniversity ✭✭✭

I'm having an issue with the EnterText method not working on iOS 9.3.2 simulated devices. I keep getting the "Timed out waiting for keyboard" error. I am not having any issues with Android.

Things to note
The code was created in Test recorder and moved to a UITest project in Xamarin Studio. The code in question simply selects a entry control, then tries to enter text into the control. The selection of the control works, but the enterText method times out waiting for the keyboard.

The code (and output) is:
app.Tap(x => x.Marked("Username"));
-Tapping element matching Marked("Username") at coordinates [ 160, 244.95 ].

app.EnterText(x => x.Marked("Username"),"UserName");
-Entering text 'UserName' in element matching Marked("Username") at coordinates [ 160, 244.95 ].
-Error while performing EnterText(Marked("Username"), "UserName") Exception: System.TimeoutException: Timed out waiting for keyboard. at Xamarin.UITest.Shared.WaitForHelper.WaitFor (System.Func1 predicate, System.String timeoutMessage, Nullable1 timeout, Nullable1 retryFrequency, Nullable1 postTimeout)"

Things I've tried:
1. Ensured automation support is turned on the simulator
2. Disconnected the hardware keyboard on the simulator
3. Reset the simulator
4. Toggle the keyboard

Environment
Xamarin.UITest 1.3.10.0

The app I'm testing is using the following packages
Xamarin.TestCloud.Agent 0.19.1
Xamarin.Forms 2.2.0.45

Thanks in advance.

Posts

  • JohnSheehyJohnSheehy USMember

    Hello LyndonHughey,

    Just wondering if you have solved this? I am having the same problem.

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    @JohnSheehy
    I was able to resolve the problem by checking on for the following things:

    -Make sure that your project either references a storyboard to ensure proper scaling OR ensure that you have all of the right default images to set the scaling properly. I personally like adding an empty storyboard to my projects. The problem with the enterText is is most prevalent in larger devices, like the iPhone Plus phones.

    -Check to make sure that your iOS project is set to enable debugging, setting a debug compilation condition is not enough. I've noticed that the EnterText functionality seems to take a deeper level of automation than pressing buttons and scrolling. So, if your debugging functionality is not properly enabled, you will likely be able to partially run UI tests, but it will fail on the EnterText command.

    I hope that helps.

  • JohnSheehyJohnSheehy USMember

    @LyndonHughey - Thanks very much for the reply. I will try your suggestions and let you know how I get on.

    Thanks again :)

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    No problem, John. Sorry for the late reply.

  • JuanPabloSillerJuanPabloSiller USMember ✭✭

    For me tapping the text input before entering the text fixes the issue although simulators with iOS 10 or above still give issues from time to time.

  • @LyndonHughey - Could you please explain briefly what you faced problem

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    @BhaurajBiradar.9064 said:
    @LyndonHughey - Could you please explain briefly what you faced problem

    @BhaurajBiradar.9064 Its been over a year, so I don't remember the exact reason I was having a problem. But I think it was related to scaling problems on the "S" sized iOS simulators and a scaling problem related to not having the correct scaling defined for the app. I resolved the scaling problem by inserting a blank storyboard. This allowed the simulator to correctly define the coordinates.

  • Hi @LyndonHughey - Thanks for reply, It didn't solved my problem. I tried all options.

Sign In or Register to comment.