package mka.com;
import android.app.Instrumentation;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.By;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject2;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class MKATest {
Instrumentation minstrument;
UiDevice Device;
@Before
public void setUp(){
minstrument= InstrumentationRegistry.getInstrumentation();
Device=UiDevice.getInstance(minstrument);
}
@Test
public void se(){
UiObject2 list = Device.findObject(By.clazz("android.widget.LinearLayout"));
for (UiObject2 child : list.getChildren()) {
child.getVisibleBounds().contains(118,429,143,470);
if (!child.getClassName().equals("android.widget.CompoundButton")) {
continue;
}
child.click();
}
}
}请问老师 正常运行 但没点击 是那出了问题加QQ群 没回应
目前暂无任何回答
- 0 回答
- 0 关注
- 978 浏览
添加回答
举报
0/150
提交
取消