简体   繁体   English

Android Appium:无法在文本框中输入文本

[英]Android Appium : Not able enter the text in textbox

//For log in scenario, I just want to enter the userID and password. //对于登录场景,我只想输入用户名和密码。 I tried with different Xpath but still it's not able to identify the box.我尝试了不同的 Xpath 但仍然无法识别盒子。 every-time getting an no such element exception.每次都没有这样的元素异常。 We are using testNG.我们正在使用 testNG。 在此处输入图像描述


@AndroidFindBy(xpath = "XYZ")
public MobileElement txtUserName;

utils.EnterText(UserNameorMailId,txtUserName);


Different Xpath tried: xyz is placeholder.不同的 Xpath 试过:xyz 是占位符。

 //*[@id='username'] 
//*[@text='Edit Text  ;  Email Address or Username']
//*[@id='layout_usename']//*[@text='Edit Text  ;  Email Address or Username']

Error message:错误信息:

Method threw 'org.openqa.selenium.NoSuchElementException' exception. Cannot evaluate io.appium.java_client.android.AndroidElement$$EnhancerByCGLIB$$34efbdcd.toString()

I am not sure what else I should try and what exactly the issue is...Help is really appreciated..我不确定我还应该尝试什么以及问题到底是什么......非常感谢帮助......

What's the exact error you are getting while entering text?您在输入文本时遇到的确切错误是什么? In case you are able to find the element Can you try to use ".//*[@text='Email Address or Username']"如果你能找到元素你能尝试使用“.//*[@text='Email Address or Username']”吗

Can you try using AndroidElement instead of MobileElement ?您可以尝试使用AndroidElement而不是MobileElement吗? From the docs, I can see that MobileElement is an abstract class which is inherited by AndroidElement class, so using an object of an Abstract class may not work.从文档中,我可以看到MobileElement是一个抽象 class,它由AndroidElement class 继承,因此使用抽象 ZA8CFDE6331BD59EB2AC96F8911C4B6666Z 的 ZA8CFDE6331BD59EB2AC96F8911C4B6666Z 可能不起作用。

MobileElement: https://appium.github.io/java-client/io/appium/java_client/MobileElement.html MobileElement: https://appium.github.io/java-client/io/appium/java_client/MobileElement.html

AndroidElement: https://appium.github.io/java-client/io/appium/java_client/android/AndroidElement.html AndroidElement: https://appium.github.io/java-client/io/appium/java_client/android/AndroidElement.html

Does clicking on the textbox produce the same error?单击文本框会产生相同的错误吗? Have you try setValue instead?您是否尝试过 setValue ?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在nexus 4 android 4.2.2上的webview中输入文本 - not able to enter text in webview on nexus 4 android 4.2.2 无法在 appium 中使用 SendKeys 方法输入数据 - Not able to enter the data with SendKeys Method in appium 无法在编辑文本android列表视图中输入和编辑值 - Not able to enter and edit values in edit text android list view 使用TestNG,AVD Simulator,Appium Server,SendKeys需要花费大量时间在Android App Automation中输入文本 - SendKeys taking to much time to enter text in Android App Automation Using TestNG,AVD Simulator,Appium Server Appium,无法在Android本机应用程序上读取包含内容描述和索引的文本 - Appium , not able to read text having content desc and index on an Android native app 无法在 Appium 自动化中找到 Android 应用程序的 Snackbar - Not able to find Snackbar of Android app in Appium automation 无法实例化android驱动程序appium 1.8.1 - Not able to instantiate android driver appium 1.8.1 无法执行Appium Android本机代码 - Not able to execute appium android native code 无法使用Appium for Android应用程序在WebView中切换 - Not able to switch in webview using appium for android application Appium无法识别和滚动Android设备上的元素 - Appium not able to identify and scroll element on android device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM