Skip to content

Android - Error when trying to use sendKey or clear function on WebElement obtained with driver.findElement(new AppiumBy.ByAndroidViewTag("myTag")); #2183

@darcheville

Description

@darcheville

Hello,

I get an error when i try to use sendKey or clear functions on WebElement obtained with driver.findElement(new AppiumBy.ByAndroidViewTag("myTag"));

 WebElement network = driver.findElement(new AppiumBy.ByAndroidViewTag("myTag")); => ok, no error
  network.click(); => ok, no error
  network.sendKeys("test"); or network.clear(); => not ok, i get an error 

=> Stack trace
Exception in thread "main" org.openqa.selenium.InvalidElementStateException: Could not perform sendKeys/setValueImmediate action on the element 0e3f8f3e-5e28-414b-93f0-0809452d52f2
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.1.1', java.version: '22.0.1'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [ac783605-bf94-4b80-b61f-ce1b09aae574, sendKeysToElement {id=0e3f8f3e-5e28-414b-93f0-0809452d52f2, value=[Ljava.lang.CharSequence;@3b77a04f}]
Element: [[AndroidDriver: on ANDROID (ac783605-bf94-4b80-b61f-ce1b09aae574)] -> -android viewtag: myTag]
Session ID: ac783605-bf94-4b80-b61f-ce1b09aae574
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:223)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:110)

Process finished with exit code 1

Please help,
Thanks and Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions