Warning: file_put_contents(/datas/wwwroot/jiajiahui/core/caches/caches_template/2/default/show.php): failed to open stream: Permission denied in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 55

Warning: chmod(): Operation not permitted in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 56
Appium和UIAutomator英文和数字输入问题记录 - 源码之家

Appium和UIAutomator英文和数字输入问题记录

Appium对中文支持有问题已经是众所周之得了,但是今天用Appium编写一个创建Note的实例的时候发现Appium对含有英文和数字的字串输入也有问题。</span>

比如如果想用driver.sendkeys来输入“Note1",事实上你会得到的是Note。实践中发现如果英文字串和数字之间加多一个空格就能解决问题,比如输入”Note 1",最终得到的就会是"Note1".

实践发现UIAutomator存在同样的问题,因为Appium底层调用的就是UIAutomator,所以最终的Bug应该是是属于UIAutomator这一边的。

以下Appium代码可以验证这个问题:

        //Enter the note info and save it         WebElement text = driver.findElementByClassName("android.widget.EditText");        <span style="color:#ff0000;"> text.sendKeys("Note 1");</span>                  driver.sendKeyEvent(82);         el = driver.findElement(By.name("Save"));         el.click();                  //Find out the new added note entry         List <WebElement> entries = driver.findElements(By.className("android.widget.TextView"));                  WebElement targetEntry = null;         for(WebElement entry : entries) {         	<span style="color:#ff0000;">if(entry.getText().equals("Note1")) </span>{         		targetEntry = entry;         		break;         	}         }


 

作者

自主博客

微信

CSDN

天地会珠海分舵

http://techgogogo.com


服务号:TechGoGoGo

扫描码:

Appium和UIAutomator英文和数字输入问题记录

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。