Sendkeys() shown as deprecated method when used with driver.findElement(mobileBy.AndroidUIAutomator("text");

MobileElement ele4=(MobileElement) driver.findElement(MobileBy.AndroidUIAutomator(“text(“Message:”)”));
ele4.click();
((HasInputDevices) driver).getKeyboard().sendKeys(“Test 1”);

I am using Appium v1.15.1
java 1.8
node.js.v6.9.4

@Gaurav_Jagtap you did not mention java-client version? Appium version does not matter.

java-client: 7.3.0

((RemoteWebDriver) driver).getKeyboard().sendKeys("NO_PROBLEM");

if we tap on sendKeys it goes to -> “package org.openqa.selenium.interactions;” which is inside “java-client-7.3.0.jar” of Appium java-client package.

  /**
   * Sends keys to the keyboard representation in the browser.
   *
   * Special keys that are not text, represented as {@link org.openqa.selenium.Keys} are recognized
   * both as part of sequences of characters, or individually.
   *
   * Modifier keys are preserved throughout the lifetime of the send keys operation, and are
   * released upon this method returning.
   *
   * @param keysToSend one or more sequences of characters or key representations to type on the
   *                   keyboard
   * @throws IllegalArgumentException if keysToSend is null
   */
  void sendKeys(CharSequence... keysToSend);

@Aleksei.I have added the java-client: 7.3.0 in my project.But i am not able to see the package org.openqa.selenium.interactions;” which is inside “java-client-7.3.0.jar” of Appium java-client package.

Please suggest.

@Aleksei. Kindly suggest from where can i download jar file which has the above mentioned package

@Aleksei Please suggest which are the important Java client versions that need to installed for smooth running of scripts in Appium

i use maven and just adding all components there like:

        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.3.0</version>
        </dependency>

image

@Aleksei I have written my scripts in TestNG.

i am also. but “maven” is another thing.

The Java client 7.3.0 i have added is it the correct one?

looks correct. i suggest convert your project into maven to forget about manual add any dependancies - > https://www.jetbrains.com/help/idea/convert-a-regular-project-into-a-maven-project.html

PS it is also said https://github.com/appium/java-client how to add appium java-client to maven

Ok will try…i have never done a Maven project before