LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

How can I write good test cases for UI testing?

I want to know how can I write good test cases for UI testing. Can anyone please help me out with it.

Up Vote Down Vote 0 Votes
Posted 3 months ago

Answers


If the test cases are written in a proper way, they provide greater test coverage and efficient testing. So, it should be a thought-out process. Here are some tips to write better test cases.

  • If possible, go for writing test cases under test scenarios only. Test scenarios are like the headline of an article and test cases get direction if written under test scenarios.
  • Include the conditions required for the execution of the tests and the final expected result. This helps other testers know the intended purpose of the test quickly.
  • Do not focus on just positive cases only. Remember to jot down negative test cases as well.
  • Always use corner test cases or exception test cases. This may include “What if the user enters a number as an email id” etc.
  • Do not create dependent test cases. For example, a test case providing “Show My Plan” only after “Login” on LambdaTest. Since a user does not always follow a specific order in browsing the website, your test cases also should not follow it. Create test cases to test such scenarios also.
  • Remember to include the following in the test case:Test Case IDTitle of the test caseRisk Level (High/Low)Type of testing used

A test case is very specific to functionality while the test scenarios are vast and generic. In the section of test scenarios, there was a brief mention of writing a test scenario on “login functionality”. As test cases come under the test scenarios, let’s consider the same test scenario.

For the above login page of LambdaTest, the following test cases can be written:

  • Analyse the system behaviour and outcome when valid email id and password are entered.
  • Analyse the system behaviour and outcome when invalid email id and password are entered.
  • Analyse the system behaviour and outcome when valid email id and invalid password are entered.
  • Analyse the system behaviour and outcome when invalid email id and valid password are entered.
  • Analyse the system behaviour and outcome when “Remember Me” is checked.
  • Analyse the system behaviour and outcome when “Remember Me” is not checked.
  • Analyse the system behaviour and outcome when “Forgot Password” is selected.
  • Analyse the system behaviour and outcome when login/sign up is done through Google. Remember that these test cases come under the overall umbrella of the test scenario “Login Into LambdaTest”.
Up Vote Down Vote 0 Votes
Posted 3 months ago