A Test Scenario is a statement describing the functionality of the application to be tested. It is used for end to end testing of a feature and is generally derived from the use cases.
Test scenarios can serve as the basis for lower-level test case creation. A single test scenario can cover one or more test cases. Therefore a test scenario has a one-to-many relationship with the test cases.
What is Scenario Testing?
Scenario testing is a type of testing carried out using scenarios derived from the use cases. Using scenario testing, complex application-logic can be tested using easy to evaluate test scenarios.
Some characteristics of scenario testing are
- Coherent – The test scenarios should be based on a coherent story about how the software application is used.
- Credible – They should be credible and focus on something that could happen in the real world.
- Motivating – They should motivate the stakeholders to get the issues fixed in case of the failed test scenario.
- Complex – The test scenarios normally involves a complex program or application flow.
- Easy to evaluate – The test result of the test scenario should be easy to evaluate as they involve complex logic.
Strategies to Create Good Scenarios
- Enumerate possible users their actions and objectives
- Evaluate users with hacker’s mindset and list possible scenarios of system abuse.
- List the system events and how does the system handles such requests.
- List benefits and create end-to-end tasks to check them.
- Read about similar systems and their behavior.
- Studying complaints about competitor’s products and their predecessor.
Scenario Testing Risks
- When the product is unstable, scenario testing becomes complicated.
- Scenario testing are not designed for test coverage.
- Scenario tests are often heavily documented and used time and again
Functional Test Scenarios for Login Page
- Verify that as soon as the login page opens, by default the cursor should remain on the username textbox.
- Verify that the user is able to navigate or access the different controls by pressing the ‘Tab’ key on the keyboard.
- Verify that the password is in masked form when entered.
- Verify if the password can be copy-pasted or not.
- Verify that the user is able to login by entering valid credentials and clicking on the ‘Login’ button.
- Verify that the user is able to login by entering valid credentials and pressing the Enter key.
- Verify that the user is not able to login with an invalid username and password.
- Verify that the validation message gets displayed in case the user leaves the username or password field as blank.
- Verify that the validation message is displayed in the case the user exceeds the character limit of the user name and password fields.
- Verify that reset button functionality on the login page. Clicking on it should clear the textbox’s content.
- Verify if there is a checkbox with the label “remember password” on the login page.
- Verify that closing the browser should not log-out an authenticated user. Launching the application should lead the user to the login state only.
Difference between Test Case and Test Scenario
|Test Case||Test Scenario|
|A test case contains clearly defined test steps for testing a feature of an application.||A test scenario contains high-level documentation, describing an end to end functionality to be tested.|
|Test cases focus on “what to test” and “how to test”.||Test scenarios just focus on “what to test”.|
|Test cases have clearly defined steps, pre-requisites, expected results, etc. Hence, there is no ambiguity.||Test scenarios are generally one-liner. Hence, there is always a possibility of ambiguity during testing.|
|Test cases can be derived from test scenarios and have many to one relationship with them.||Test scenarios are derived from use cases.|
|Test cases are efficient in exhaustive testing of applications.||Test scenarios are beneficial in quick testing of end to end functionality of the application.|
|More resources are required for documentation and execution of test cases.||Relatively less time and resources are required for creating and testing using scenarios.|