How do I reuse a login across several tests?
Record it once as a block in “Blocks,” then pick it when you create a test: Qanary replays it first, and re-recording it updates every test.
In Qanary, a series of steps shared by several tests, such as signing in to a customer account, is recorded only once, as a block. Every test that starts with this block replays it, and when the sign-in changes on your site, you re-record the block once: all the tests that use it follow.
Create a block
- In Qanary’s left menu, open “Blocks.”
- Click “New block,” give it a name (“Login,” for example), a starting URL, and a screen size.
- Go through the journey in Qanary’s browser, as you would for a test, then click “Save.”
Expected result: the message “Block “Login” created. Pick it when you create a test.” appears, and the block joins the list, with the number of tests that use it.
Start a test with a block
- Click “Create a new test.”
- Under “Start with a block (optional),” choose the block.
- Click “Run “Login” then record.”
Qanary first replays the block (“Running the block “Login”…“), then recording starts on the page where the block ends. In the test, the block counts as a single step, which you can expand.
Turn existing steps into a block
On the page of a recorded test, or while recording, select the first steps, then click “Group.” You can then create a “New block” with these steps, or replace them with an “Existing block.” The selection must start at step 1, and the steps must follow one another, with no gaps.
Update a block
On the block’s page, “Re-record” replaces all its steps with what you record. The new recording applies to every test that uses the block as soon as you click “Save.” The block’s page lists these tests, under “Used in.”
To stop a single test from following the block, open the block’s menu in that test and choose “Ungroup”: its steps are copied into the test.
The limits of blocks
- At the start of a test only. A block can’t go in the middle of a journey.
- One screen size. A block only works in tests recorded on the same screen size.
- No block inside a block.
- It doesn’t run on its own: a block replays as part of a test.
- Deleting a block also deletes the tests that use it, after a confirmation that says how many. To keep a test, ungroup it first.
If it doesn’t work
If the message “The block “Login” failed at step…” appears at the start of a recording, check that your site’s sign-in page hasn’t changed, or re-record the block.
Frequently asked questions
Is the block’s password protected?
Yes, just as in a test: a password field is automatically marked as sensitive. See How do I edit a test that’s already recorded?.
Can a block be used in another project?
No. A block belongs to its project.
Was this article helpful?
Thanks. We’ll tell the canary.


Still have a question? Julia or Antoine will reply within 24 business hours at contact@qanary.dev. A human, not a bot. The canary stays down the mine.
For your AI assistant: this article as text, the help center index, the glossary.