0

How could I write a testcase in Android JUnit, where I need to test whether a click event on button is working on not. Could anyone help me on this.

Regards Deepak

1 Answer 1

1

You should use android.test.TouchUtils to create a click simulation and override onClick of the button to test whether it is coming into that method. This could be done using a boolean which is set to true inside onClick

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.