In Appium Sendkeys didn't work as expected, it sends more than i give to it

自闭症网瘾萝莉.ら 提交于 2020-01-04 06:50:42

问题


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



来源:https://stackoverflow.com/questions/34989966/in-appium-sendkeys-didnt-work-as-expected-it-sends-more-than-i-give-to-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!