.sendKeys and .click is not working with AVD

Can anyone help me with:
I have tried to use driver.findelement(By.id(“buttonId”)).click() but it did not work.
Even it returns size = 1, when I use driver.findelements(By.id(“buttonId”)).size().

The element.sendKeys(“username”) is not working.
Driver .tap(1,element,1) worked. What could I use for sendKeys()?

1 Like

What is selenium version you are using?

Selenium Version: 3.5
Appium Version: 1.6.5

Try with below
java-client-4.1.2
selenium 2.53.0

I am facing the same problem. I am using java-Client 4.1.2. I have used io.appium.java_client.android.AndroidDriver But click() is not working. driver.tap() helps me, but I want to know why click is not working. I am creating a script for Android studio emulator(Version 6.0, x86) contact application.

I am using Selenium 3.4.
but as there is driver is an instance of Android driver class, so i think it should not effect much if I use later version

@jitenderbhardwaj

  1. enable in developer options on phone “show touches” + “show touch data” to see where TAP/CLICK actually happens (if it happens :slight_smile: )
  2. try to user MobileBy instead of By
        driver.findElement(MobileBy.id(“buttonId”)).click()
  1. try to use TOUCH instead of CLICK as more native for phones
        WebElement el = driver.findElement(MobileBy.id("someID"));
        new TouchAction((MobileDriver) driver).press(el).waitAction(Duration.ofMillis(70)).release().perform();