Search code examples
javaappiumkeypressjava-client

Unable to hit Key combination after "java_client" update


I am working on Appium Desktop(Version 1.6.2 (1.6.2)) Recently, I have updated "java_client-4.0.0" to "java_client-6.1.0" and I am facing several issue. One is that I am not able to enter Key Values in Capital case (i.e. "A"). As all the Key Stroke methods has been deprecated and the working one is "KeyEvent" which only take one parameter

Example Code:

Earlier:- driver.pressKeyCode(AndroidKeyCode.A, AndroidKeyMetastate.META_SHIFT_ON); **This line of code press letter "a" with Shift "on" i.e Capital letter "A"

Current:- driver.pressKey(new KeyEvent(AndroidKey.A)); **As "pressKeyCode" is deprecated, I used "pressKey" which only takes one parameter and I am not able to click "SHIFT"

Let me know if any more detail needed.


Solution

  • I suggest to refer latest appium java client tests for more usage of new methods

    Here is the link