To reduce redundant setup steps in plan runs, you can now reuse signed-in session data from a login flow across tests in a plan run. When Persist browser state after flow execution is enabled for a login flow, the first test that runs the flow stores the session. Subsequent tests in the same plan that visit the same application with the same credentials will apply the saved session data and bypass the login flow.
Try it out
To reuse a signed-in session across a plan run, update the login flow and organize your plan into stages.
Update the login flow
- Open a test containing the target login flow in the mabl Trainer.
- Edit the login flow.
- On the Basics tab, turn on Persist browser state after flow execution.
- Make the login steps in the flow conditional, so that the flow only runs if the user isn't already logged in. For example, "if 'Log In' button is present."
- Save your changes.
This setting applies to every instance of the flow, so every test calling it picks up the same behavior.
Organize tests into stages
Because session data is only stored after the initial flow finishes, you must structure your plan sequentially across stages:
- First stage - Place a test that executes the login flow here to capture and save the authenticated session
- Later stages - Place subsequent tests using the same login flow and credentials in later stages
When tests in later stages reach the login flow, mabl automatically applies the session data, the conditional step in the flow evaluates to false, and the test continues from a logged in state.
Note
- Session state is shared only within a single cloud plan run, and only between tests using the same application and the same credentials.
- A flow configured to loop is left out of the exchange.