I have been writing some automation test scripts for a mobile application. Thus far my tests are very basic, I am struggling to know exactly what to test.

An example of a test I have written: Enter valid login credentials > click submit button > (if element on new page is visible) > pass else fail

So to test a click through I am just checking if an element on the newly loaded page is visible.

I am guessing this is very bad practice. Should I be testing server responses or something else? what exactly should I test to determine success in similar scenarios.

1 Answer 1


Test behavior. Don't test trivialities.

GUI's are notoriously difficult to test. That's a major reason logic should be removed from them. Strip a GUI of any logic and there isn't anything to test in the GUI so it becomes a non issue.

Why in the world can't login credential logic be tested without worrying about some elements visibility?

An element's visibility should reflect the state of the model. An integration test can go as far as testing that the model is in the correct state for the login status. All that can be done without involving the GUI.

  • Thanks for your input, its a little cryptic. Are you basically saying I shouldn't test the login system with automation I should use a unit test? or are you saying that I should not have a test clause when testing GUI, it should just be tested by its functionality alone? Commented Sep 12, 2016 at 0:13
  • I'm saying you should be able to test the login system without involving the GUI at all Commented Sep 12, 2016 at 1:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.