what key is used to press ENTER key when searching data in mobile application?
I’ve used this code but it does not work Mobile.sendKeys(findTestObject(``'TestObject'``), Keys.chord(Keys.ENTER``))
and it doesn’t work too Mobile.sendKeys(``'Katalon Studio'``)
Maybe you could try clicking the test object first? I know sendKeys should be enough, but this workaround (first click the object, than pres ENTER) worked for me before.
I sendKeys successfully but then can’t perform enter action i use this code please see the code and tell me if i make mistake somewhere : Mobile.sendKeys(findTestObject(‘SearchBox’), Keys.chord(Keys.RETURN))
Yes i have imported this and there is no error message the test is pass but when i look at the test i see that this command sends something invalid characters (like envelope).
I am doing this before perform enter and it’s working:
I did just see that pressKeyCode is deprecated in newer versions of Appium. Could you tell me which version of Appium you’re using? Katalon Studio 5.10.x only supports Appium 1.8.1 (or 1.8.2-beta).
You could also try switching the pressKeyCode line with:
When I run that pressKeyCode on my test, I see the same thing that you see where it looks like it’s not running, but in my case it actually does execute.
Could you please let me know what version of Katalon Studio, Appium, and Android you’re testing on?
(I do see the underline for pressKey myself, but I don’t think it’s an issue - I think it has to do with the way that the AndroidDriver is being used with a generic type. If the pressKey function was truly not available, you should see a crash when running the test.)
Something that might work better for you would be to tap the field that you’re trying to enter text into. Then use the sendKeys() function instead of setText(). Here’s some info on how to use it: