byselector专题

UiAutomator2—By、BySelector

UiAutomator2—By、BySelector By和BySelector所实现的功能相同,API也基本上相同,By是对BySelector的简化,官网是这样解释的: By is a utility class which enables the creation of BySelectors in a concise manner. Its primary function is t

Uiautomator 2.0之BySelector类学习小记

1. BySelector与By静态类 1.1 BySelector类为指定搜索条件进行匹配UI元素, 通过UiDevice.findObject(BySelector)方式进行使用。 1.2 By类是一个实用程序类,可以以简洁的方式创建BySelectors对象。主要功能是使用缩短语法,提供静态工厂方法来构造BySelectors对象。例如:你将使用findObject(By.text("f