In my application, I want to change the screen orientation and perform a click action on the button using Espresso.
I have tried all the solution mentioned over the internet, but nothing works. It's not changing the screen orientation. Can someone help me?
This is what I have tried:
ComposePageObject.clickComposeButton();
mActivityRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Thread.sleep(5000);
Do I need to create any custom class for this?