Hi guys,
I’m facing this error when i try to set text
Could you guys help me?
Thank you
From the error, it looks like you’re trying to set the text on an element that isn’t really a text input field. Could you share what the layout of the screen looks like without the error dialog in the way? You might want to try setting the text on one field deeper than you are trying now (or one field up).
If that doesn’t work, you might need to use either the MobileBuiltInKeywords.sendKeys() function or set your test to click on the keypad buttons themselves.
Hope this helps,
Chris
This looks like a custom form interface and it doesn’t look like there is a typical text entry field. Since the keypad is open, we might be able to interact with it directly:
import io.appium.java_client.android.AndroidDriver
import io.appium.java_client.android.AndroidKeyCode
AndroidDriver<?> driver = (AndroidDriver<?>) MobileDriverFactory.getDriver()
driver.pressKeyCode(AndroidKeyCode.KEYCODE_NUMPAD_1)
driver.pressKeyCode(AndroidKeyCode.KEYCODE_NUMPAD_2)
driver.pressKeyCode(AndroidKeyCode.KEYCODE_NUMPAD_ENTER)
Where the keypad keys are KEYCODE_NUMPAD_0 - KEYCODE_NUMPAD_9.
Hope this helps,
Chris