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群 没回应
相关分类