在如预期Appium的SendKeys没有工作,它发出比我给它 [英] In Appium Sendkeys didn't work as expected, it sends more than i give to it

查看:878
本文介绍了在如预期Appium的SendKeys没有工作,它发出比我给它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Appium写一个Android应用程序的测试情况下,当我点击以下code

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"); 
            }   

在我场数量,而不是1送11。
如何降低写入速度,以确保只有我给号写入不加倍。

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.

推荐答案

@Emna我beleieve它调用 EnterQuantity()的两倍。尝试添加点击元素(如提交按钮)这个函数里面来缩小的根本原因。

@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

这篇关于在如预期Appium的SendKeys没有工作,它发出比我给它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆