[error] variable "KEY_0" is not defined

Trying to type numbers using Sendkeys and Xtype but I’m getting this error. This happens for all numbers [0-9] and also for ${KEY_NumX}.

Hi, I confirmed this issue and logged an error - thanks for reporting it!

Workaround: Note that you need the ${KEY_1} notation for standard keys only if you want to combine them with the modifier keys ${KEY_CTRL}, ${KEY_ALT} and ${KEY_SHIFT}, or with special keys like ${KEY_TAB}. “Combine” in this context means: Press 2 or more keys at the same time, like ${KEY_CTRL+KEY_V}.

If you only need to send text, you can just use XType | 1,2,3,...,9 hello world without any special notation for the keys. This even works with non-keyboard characters like “€” or “你好” - hello in Chinese. XType still simulates native keypress events.

With today’s update, this issue is fixed :slight_smile:


I just discovered Kantu today, and am blown away by it! The perfect tool for desktop automation/testing I was searching for.

The issue is that I’m using 4.0.1, and trying to use XType | 1 to type numbers in an appetize.io frame (to auto test an Android app embedded in an iframe), and the numbers typing doesn’t work.

I tried:
Command: XType
Target: ${KEY_1} --> doesn’t work (the field in my android app doesn’t get filled with 1)

Command: XType
Target: 1 --> doesn’t work (the field in my android app doesn’t get with 1 either)

Is it a regression, since you mention in your Dec’18 message that the issue was fixed?

Thanks for your help

Note that I’m using a workaround for the moment: use XClick to locate the numbers on the “Android” keyboard in the appetize.io frame to press on the numbers

I confirmed that KEY_1 and the other numeric keys do not work yet correctly. We will finally fix this with the next update. Thanks for reporting this.

Btw, appetize.io is very useful :slight_smile:

This issue is fixed with V4.1.6.

Great, thanks, it works now!