Making tests faster means you can make more tests. The more tests you make, the faster you learn about issues and releases become much easier for your team, and less burdensome to your users. With easier releases and fewer surprise issues in production, you’re able to create more features, build richer products, and provide more value to your customers. Sound too good to be true? There are a few strategies and best practices we recommend to increase your test creation efficiency in mabl, including flows, data-driven testing, and focusing your tests.
Using flows to minimize re-creating test steps
In a flow, users can group steps that together accomplish a specific action, and once made it can easily be added into any test that needs to accomplish that same action. Another benefit is that any time you need to update a flow, you only have to make the updates in one instance and those changes will synchronize across all tests using that flow.
Creating flows allows you to follow the DRY principle (“Don't Repeat Yourself”). They eliminate the need to recreate the same steps in every test created, and reduce duplicative work for your team, as flows are shared across an entire mabl workspace. Given that updates only have to be made within one instance of a flow, it reduces the burden of maintenance long-term.
Parameterized flows keep steps in sync across your tests even
when different values are used within each test.
Data-driven testing is the process of loading external data to your tests, which allows for testing multiple data inputs across the same tests. Data-driven testing is reusable, so tests can be written once and executed repeatedly by simply changing or iterating on the data inputs. It enables stronger test coverage because input data can be changed to cover different paths throughout a single test. As an additional safeguard, data-driven testing maintains a clean separation of logic between your test case logic and test data.
Data tables define different sets of data to use within a test.
Example of using data-driven variables in test steps.
Focus your tests on the elements that matter
Focusing your tests allows you to not only create them more quickly, but also reduces the time spent on test maintenance. Tests are faster and simpler to review when focused, making the process more efficient while actually increasing the value. A few ways you can create more focused tests include:
- Use visit URL steps: skip navigation steps that aren’t critical to your test
- Create focused assertions: check that assertions only validate the functionality you’re trying to test
- Generate data via API: consider using an API call to generate test data and skip UI actions
Example: consolidation of multiple steps (A) instead using Visit URL (B).
Learn more about how you can optimize test creation. Check out the full session from the Experience event:
Not using mabl today? Sign up for your free trial to see how fast you can create and execute automated tests.