Keyboard won't go away and causes Element NotInteractable Exception

I’m working on a mobile app test in Katalon Studio and I’m totally stuck on a forms page. I have a test case where the script fills out a few text fields (Name, Email, etc.). The problem is, as soon as Katalon types into the last text field, the device’s on-screen keyboard stays open.

Because the keyboard is up, it completely covers the ‘Submit’ button at the very bottom of the screen. When Katalon tries to execute Mobile.tap(findTestObject('path/to/submit_btn')), the test fails with an error saying it can’t interact with the element or that the item is hidden.

I tried adding a Mobile.delay(3) thinking it would just slide down on its own, but it doesn’t. I also tried tapping a random spot on the screen, but half the time it accidentally clicks another input field and messes up the data. How do I cleanly force the keyboard to hide so my script can see the Submit button?

HI Wazir,
This is a very common mobile automation issue. The best approach is not to rely on delays or random taps, because they are unreliable and can make tests flaky.

Katalon provides some built-in keywords specifically for this scenario:

Mobile.hideKeyboard()

So you can use the above keyword like, after entering text in the last field, explicitly hide the keyboard before interacting with elements that may be covered:

Mobile.setText(findTestObject('txt_Name'), 'John Doe', 0)
Mobile.setText(findTestObject('txt_Email'), 'john@test.com', 0)

// Hide the soft keyboard
Mobile.hideKeyboard()

// Optional wait for stability
Mobile.delay(1)

// Tap Submit button
Mobile.tap(findTestObject('btn_Submit'), 10)

If the button is still not visible after hiding the keyboard, you may also need to scroll it into view:

Mobile.hideKeyboard()

Mobile.scrollToText('Submit')
Mobile.tap(findTestObject('btn_Submit'), 10)

Try this and let us know

To fix the keyboard staying open and causing an Element Not Interactable Exception in Katalon Studio mobile tests, use the built-in Mobile.hideKeyboard() keyword immediately after typing in the last text field and before tapping the Submit button.

Recommended Solution

Add this sequence to your test case:

// Fill text fields
Mobile.setText(findTestObject('txt_Name'), 'John Doe', 0)
Mobile.setText(findTestObject('txt_Email'), 'john@test.com', 0)

// Force keyboard to close
Mobile.hideKeyboard()

// Optional: brief wait for stability
Mobile.delay(1)

// Tap Submit button
Mobile.tap(findTestObject('btn_Submit'), 10)

If the Button Is Still Not Visible

If hiding the keyboard doesn’t make the Submit button clickable, scroll it into view first:

Mobile.hideKeyboard()
Mobile.scrollToText('Submit')
Mobile.tap(findTestObject('btn_Submit'), 10)

Why This Works

Approach Problem Why It’s Flaky
Mobile.delay() alone Keyboard doesn’t auto-close; just waits
Tapping random spot Accidentally clicks other input fields
Mobile.hideKeyboard() Explicitly tells the device to dismiss the soft keyboard

This is the official Katalon approach for this common mobile automation issue, avoiding unreliable delays or random taps that make tests flaky

Note: If you’re using a numeric keypad on iOS, Mobile.hideKeyboard() may not work. In that case, tap the “Done” button on the keyboard toolbar manually

did any of the solutions work for you?

Calling the built-in keyboard dismissal tool immediately after your last setText command will solve the issue.

Switch to Script Mode and then use this built-in keyword.
Here is the example script.

Script Mode Example:

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

// 1. Type into your input field
Mobile.setText(findTestObject('Object Repository/Input_Email'), 'user@example.com', 10)

// 2. Explicitly hide the mobile keyboard
Mobile.hideKeyboard()

// 3. Now the Submit button is visible and safe to tap
Mobile.tap(findTestObject('Object Repository/Btn_Submit'), 10)