How to create Test Scenarios with Examples
Shreya Bose, Technical Content Writer at BrowserStack - May 10, 2021
What is a Test Scenario?
A test scenario, sometimes also called a scenario test, is basically a documentation of a use case. In other words, it describes an action the user may undertake with a website or app. It may also describe a situation the user may find themselves in while using that software.
Test Scenarios are created to ensure that every single functionality offered by a website or app is working as expected. To create accurate test scenarios, it is best to gather input from clients, stakeholders, and developers. This helps effectively cover all possible user scenarios and enables comprehensive testing of all business flows of the software in question.
Test Scenarios are required to verify the performance of the entire system from the users’ perspective. When creating them, testers need to place themselves in the users’ shoes so that they have clarity on what real-world scenarios the software will have to handle when made public.
Try Cross Browser Testing for Free
Why create Test Scenarios?
- Helps ensure complete test coverage
- Since test scenarios must ideally be approved by business analysts, developers, and potential customers (a control group, ideally), they would really cover everything that needs to be tested before the software goes public
- Helps to estimate the testing effort required as well as organize the testing process. It can also serve as a proposal for the client
- Helps identify the most important end-to-end user flows, which assists with organizing the testing efforts according to priority
Read More: End To End Testing: A Detailed Guide
When to not use Test Scenarios
It is not necessary to create and use Test Scenarios in the following situations:
- In case of a time crunch, or when testing an unstable website or app. Creating detailed test scenarios takes time, and creating them for unstable software makes no sense because they will change as the software stabilizes.
- When a project is following the Agile methodology of development.
- When implementing a bug fix or regression tests. If this occurs, there will already be existing documentation from previous test cycles that can be used.
How to create a Test Scenario
- Carefully study the Requirement Document – Business Requirement Specification (BRS), Software Requirement Specification (SRS), Functional Requirement Specification (FRS) pertaining to the System Under Test (SUT).
- Isolate every requirement, and identify what possible user actions need to be tested for it. Figure out the technical issues associated with the requirement. Also, remember to analyze and frame possible system abuse scenarios by evaluating the software with a hacker’s eyes.
- Enumerate test scenarios that cover every possible feature of the software. Ensure that these scenarios cover every user flow and business flow involved in the operation of the website or app.
- After listing the test scenarios, create a Traceability Matrix to ensure that every requirement is mapped to a test scenario.
Get the scenarios reviewed by a supervisor, and then push them to be reviewed by other stakeholders involved in the project.
Read More: Fundamentals of Writing Good Test Cases
Test Scenario Example
Let’s have a look at an e-commerce website and a test scenario related to its Login page.
Test Scenario
Check the Login functionality.
Ask the following questions in this scenario:
- Can the user log in with a valid email id and password?
- What happens when an invalid email id and valid password?
- What happens when a valid email id and invalid password is entered?
- What happens when an invalid email id and invalid password is entered?
- What happens when the email id and password fields are left blank and the Login button is clicked?
- Is the Forgot password? option working as expected?
- Is every link on the page working as expected?
Essentially, the test scenario should help testers check for every possible user action, and ensure that every action yields the expected result. After every test scenario is implemented, testers should be able to confidently say that they can answer every single question about that particular feature or function.
Best Practices to Create Test Scenarios
- Create one test scenario for a single requirement or user story for simplicity’s sake.
- If one test scenario does have to accommodate multiple requirements, then ensure that each requirement has been checked in isolation beforehand. Otherwise, it is easy to miss certain functions.
- If it turns out that the number of test scenarios is too large, or too expensive to run, prioritize based on customer preferences.
Difference between Test Case and Test Scenario
Test Case | Test Scenario |
---|---|
Offers detailed information on what to test, steps required for testing and the accurate result to be expected | Only details information on what feature is to be tested, and the user story associated with the feature |
Required to keep testers and developers in sync | Required so that testers know what their task is on a high level |
Consists of low-level, individual actions testers have to undertake | Consists of high-level information (usually a one-liner) about what feature should be tested |
Is derived from test scenarios | Is derived from the requirements document |
Creating test cases is a one-time effort since test cases can be reused, especially during regression testing. | As the software evolves, test scenarios may need to be changed to align with newly developed features. |
Mostly helpful for guiding individual testers on how to progress in a certain project | Most helpful in reducing complexity by listing out everything that must be tested, and helping testers create test cases for each scenario |
The Role of Real Devices in Test Scenarios
No matter the activity, all testing operations must be executed on real devices. Test Scenarios can only be effectively implemented when corresponding tests are run in real user conditions. Running them on emulators or simulators cannot provide 100% accurate results, and therefore testers and QA managers won’t be able to evaluate the testing process with precision. Any results yielding from following a test scenario would be only partially correct, and therefore the results will not be an honest barometer of software performance.
Whether manual testing or automated Selenium testing, real devices are non-negotiable in the testing equation. The device pool for testing must include not just the latest devices, but also older devices still active in the market. Since one can’t know which device will be used to access a website or app in a highly fragmented landscape, the more devices one can run tests on, the better.
In the absence of an in-house device lab (that is regularly updated with new devices and maintains each of them at highest levels of functionality), opt for cloud-based testing infrastructure. BrowserStack provides 2000+ real browsers and devices that can be accessed for testing from anywhere in the world at any time. Run parallel tests on its Cloud Selenium Grid to get faster results without compromising on accuracy. Detect the bugs and offer a high-end UX/UI to the users by automated testing in real user conditions with BrowserStack Automate.
Users can sign up, select a device-browser-OS combination, and start testing for free. They can simulate user conditions such as low network and battery, changes in location (both local and global changes), and viewport sizes as well as screen resolutions.
Try Cross Browser Testing for Free
By running tests on a real device cloud, QA managers can modulate testing processes so that they provide the desired results. Since Test Scenarios are integral to shaping a highly functional test cycle, testers and managers can utilize them accurately in every project to ensure their success.