Cannot hide keyboard with IOS simulator

Hi,

I have an issue with setting text on an IOS simulator using Katalon scripting. The text is set on the same field (email text field) although I specify in the script to set the text on the respective fields (email, password). For some reason the text is set on the email field. I am thinking the reason is because the keyboard is hiding the password field (see attached). I also tried to use the hideKeyboard function as such. Note that I have also tried to tap the “next” key on the keyboard but the tap was done on the letter “m” instead. I have not been able to find a workaround for this. Any ideas? Thanks.

FYI, this is the error thrown when performing the hide keyboard action via the record feature.

com.kms.katalon.composer.mobile.recorder.exceptions.MobileRecordException: org.openqa.selenium.InvalidElementStateException: Error Domain=com.facebook.WebDriverAgent Code=1 “Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.” UserInfo={NSLocalizedDescription=Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.}

Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

System info: host: ‘MGRANDILLO-MAC.local’, ip: ‘fe80:0:0:0:a3:2352:2275:22ba%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_275’

Driver info: io.appium.java_client.ios.IOSDriver

Capabilities {app: /Users/MGrandillo/Downloads…, appWaitActivity: *, automationName: XCUITest, browserName: , chromedriverPort: 62952, databaseEnabled: false, deviceId: 41AAE70D-37CE-421D-A1A7-9E4…, deviceName: iPhone 8, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 1800, noReset: true, platform: MAC, platformName: iOS, platformVersion: 14.5, realDeviceLogger: /Applications/Katalon Studi…, takesScreenshot: true, udid: 41AAE70D-37CE-421D-A1A7-9E4…, waitForAppScript: true;, wdaLocalPort: 62955, webStorageEnabled: false}

Session ID: b5cdcdf8-caba-47ed-bb16-3480f184608c

at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog.performAction(MobileRecorderDialog.java:631)

at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog.lambda$2(MobileRecorderDialog.java:475)

at com.kms.katalon.composer.mobile.recorder.components.MobileActionButtonWrapper$1.widgetSelected(MobileActionButtonWrapper.java:33)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3789)

at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)

at org.eclipse.jface.window.Window.open(Window.java:799)

at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog.open(MobileRecorderDialog.java:1314)

at com.kms.katalon.composer.mobile.recorder.handlers.OpenIosRecorderHandler.openRecorderDialog(OpenIosRecorderHandler.java:102)

at com.kms.katalon.composer.mobile.recorder.handlers.OpenIosRecorderHandler.execute(OpenIosRecorderHandler.java:92)

at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)

at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)

at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)

at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)

at org.eclipse.e4.ui.workbench.renderers.swt.DirectContributionItem.executeItem(DirectContributionItem.java:133)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3789)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.dropdownEvent(AbstractContributionItem.java:425)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:436)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)

at com.kms.katalon.composer.mobile.recorder.handlers.OpenMobileRecorderHandler.execute(OpenMobileRecorderHandler.java:30)

at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)

at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)

at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)

at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)

at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)

at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)

at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)

at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)

at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)

at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3789)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)

at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)

at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)

at com.kms.katalon.core.application.WorkbenchApplicationStarter.start(WorkbenchApplicationStarter.java:23)

at com.kms.katalon.application.Application.runGUI(Application.java:191)

at com.kms.katalon.application.Application.start(Application.java:102)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)

at org.eclipse.equinox.launcher.Main.run(Main.java:1447)

Caused by: org.openqa.selenium.InvalidElementStateException: Error Domain=com.facebook.WebDriverAgent Code=1 “Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.” UserInfo={NSLocalizedDescription=Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.}

Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

System info: host: ‘MGRANDILLO-MAC.local’, ip: ‘fe80:0:0:0:a3:2352:2275:22ba%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_275’

Driver info: io.appium.java_client.ios.IOSDriver

Capabilities {app: /Users/MGrandillo/Downloads…, appWaitActivity: *, automationName: XCUITest, browserName: , chromedriverPort: 62952, databaseEnabled: false, deviceId: 41AAE70D-37CE-421D-A1A7-9E4…, deviceName: iPhone 8, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 1800, noReset: true, platform: MAC, platformName: iOS, platformVersion: 14.5, realDeviceLogger: /Applications/Katalon Studi…, takesScreenshot: true, udid: 41AAE70D-37CE-421D-A1A7-9E4…, waitForAppScript: true;, wdaLocalPort: 62955, webStorageEnabled: false}

Session ID: b5cdcdf8-caba-47ed-bb16-3480f184608c

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)

at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)

at io.appium.java_client.HidesKeyboard.hideKeyboard(HidesKeyboard.java:27)

at com.kms.katalon.composer.mobile.objectspy.util.MobileActionHelper.hideKeyboard(MobileActionHelper.java:177)

at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog$5$1.call(MobileRecorderDialog.java:554)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.startThreadAndWait(ProgressMonitorDialogWithThread.java:36)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:48)

at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog$5.run(MobileRecorderDialog.java:539)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Mobile.hideKeyboard()
....
That created another error and did not work. How do we go about this issue? Note that I do not encounter this error using the app on a real android device which does not have the keyboard popup.