Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#2,183 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
android, java
領域
mobile, testing

研究方向

先使用 AppiumBy.ByAndroidViewTag("myTag") 重現回報的 AndroidDriver 情況,然後比較同一個 WebElement 上的 click()、sendKeys("test") 和 clear()。使用 InvalidElementStateException 堆疊追蹤和 sendKeysToElement 命令縮小故障範圍;當回報的操作能夠正常運作,或限制已獲得明確記錄時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Java
星號
1.3k
分支
755
平均合併
5 天 14 小時
30 天內合併 PR
8

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

appium/java-client 的其他 Issue

查看 appium/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。