简体   繁体   English

Sendkeys()不会在使用Appium的Android App中释放Element

[英]Sendkeys() not release the Element in Android App using Appium

WebElementUserAccount=driver.findElement(By.xpath("//android.widget.EditText[@content-desc='User account']"));
          UserAccount.click();
          UserAccount.sendKeys("Test");

When I use this code it is not releasing the User account element it sends the text successfully but not came out of it In the second element, I have to send the password but it will not come out from the first Element 当我使用此代码时,它没有释放User account元素,它成功发送了文本,但没有从文本中消失。在第二个元素中,我必须发送密码,但不会从第一个元素中出现

When I use 当我使用

WebElement UserName= driver.findElement(By.xpath("//android.widget.EditText[@content-desc='User account']"));
WebElement Password= driver.findElement(By.xpath("//android.widget.EditText[@content-desc='Password']"));
UserName.sendKeys("UserName"); 

The Android keybord open before sending the text and it starts writing in the second element 在发送文本之前,Android键盘已打开,并开始在第二个元素中写入

Use driver.hideKeyboard(); 使用driver.hideKeyboard(); after entering text in your first element. 在第一个元素中输入文字后。 Your keyboard might be hiding next element. 您的键盘可能隐藏了下一个元素。

Whenever you do automation its better to turn off the text suggestion(predictive text) in the mobile keyboard. 每当您进行自动化操作时,最好关闭移动键盘中的文本建议(预测性文本)。

Check whether the keyboard is displayed . 检查是否显示键盘。 If displayed use the following code: 如果显示,请使用以下代码:

driver.hideKeyboard();

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

相关问题 使用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 在执行sendkeys时,我的appium代码应用程序中的元素未突出显示吗? - When doing sendkeys the element is not highlighted in my app of appium code? Appium + Android + WebDriver findElement():sendKeys()之后找不到元素? - Appium + Android + WebDriver findElement() : cannot find element after sendKeys()? sendKeys 不是 function Appium javascript Android - sendKeys is not a function Appium javascript Android Appium sendKeys在android上真的很慢 - Appium sendKeys really slow on android 使用Appium的Xpath for Android元素 - Xpath for Android element using Appium 在 Appium (Android) 中使用 sendkeys() 在字段中输入值需要花费太多时间 - Its taking too much time to enter value in field using sendkeys() in Appium (Android) 需要使用appium为android元素识别xpath - Need to identify xpath for android element using appium Appium - 无法使用 xpath 定位 android 元素 - Appium - Unable to locate android element using xpath 使用Selenium和Appium在Android上查找和元素 - Find and element on Android using Selenium and Appium
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM