In Appium Sendkeys didn't work as expected, it

2019-08-09 11:41发布

问题:

I'm using Appium to write test cases of an Android application, when i tap the following code

 public void EnterQuantity() {
            wd.findElement(By.xpath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.LinearLayout[3]/android.widget.LinearLayout[1]/android.widget.EditText[1]")).sendKeys("1"); 
            }   

I get 11 in Quantity field instead of 1. How can i reduce the speed of writing in order to be sure that only the number i gave is written not doubled.

回答1:

Try changing your Auto-Correction setting from Language & Input Setting in android Device manually



回答2:

@Emna I beleieve it calls the EnterQuantity() twice . try to add click element(eg. submit button) inside this function to narrow down the root cause