Rakesh Sharma

Results 2 comments of Rakesh Sharma

Consistently happening for me. Device restart resolves sometimes but once it appears, consistency is 10/10 post that: 04-23 17:22:13.108 12796-12812/? E/AndroidRuntime: FATAL EXCEPTION: Thread-2 Process: com.example.rakeshs.uiautomator, PID: 12796 java.lang.IllegalStateException: UiAutomation...

Looks to be some sync issue which got resolved for me on adding some sleep before executeShellCommand(): mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); assertThat(mDevice, notNullValue()); mDevice.pressHome(); InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand("pm clear "); openApp(getConfigProperty()); .... .... Thread.sleep(5000);...