kyrax kyrax -4 years ago 638
Android Question

Android Espresso - Click checkbox if not checked

I have

, but i only want to do this if the check box is not already checked. How can I do this in espresso?

Answer Source

This seems to be part of your test, that the checkbox needs to be checked. You can check this by onView(withId(; If this fails, your test will fail, which may be good in your case. Then, you can perform the click you want after this case matches. If this is not the situation you want, can you explain more on what you are trying to do in this Espresso Test?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download