简体   繁体   English

无法在 appium 中使用 SendKeys 方法输入数据

[英]Not able to enter the data with SendKeys Method in appium

I am trying to enter my email address in the field, but when I inspect the element I see a very big rectangle for the edit box.我试图在字段中输入我的 email 地址,但是当我检查元素时,我看到编辑框有一个非常大的矩形。 Though I am able to find that through class name.虽然我可以通过 class 名称找到它。 but when I try to enter the value through SendKeys method, My test gets passed, but I am not able to see the text entered in the field.但是当我尝试通过SendKeys方法输入值时,我的测试通过了,但我看不到在字段中输入的文本。 Take a look at the screenshot of the mobile view.看一下移动视图的屏幕截图。 Mobile View移动视图

Thanks in advance.提前致谢。

Your definition for Email_input is by class name and not an xpath, so you don't need the forward slashes.您对 Email_input 的定义是 class 名称而不是 xpath,因此您不需要正斜杠。 It should be:它应该是:

private By Email_input = By.className("android.widget.EditText");

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM