How to freeze an AI instruction
What do we mean by "freezing" the instruction?
Every time you run a test, the AI will try to find the best selector for the element you are trying to interact with.
If the AI finds a good selector, it will suggest you to freeze the instruction with it.
Freezing the instruction with a suggested selector is a good idea if:
- You believe that the suggested selector is unlikely to change in the future
- You want to speed up the test execution
How to freeze the instruction
To freeze the instruction, you first need to run the test normally.
If the AI finds a good selector, it will suggest you to freeze the instruction by showing the "Lock" icon on the top right corner of the instruction.
You can mouse over the "Lock" icon to see the suggested selector and decide if you want to freeze the instruction with it.
If you are satisfied with the suggested selector, you can click on the "Lock" icon to freeze the instruction.
Once frozen, the instruction inputs will be disabled and the selector will be used for the future tests.
Later, if you want to unfreeze the instruction, you can click on the "Lock" icon again to unlock the instruction and repeat the process.
Difference between frozen instructions and custom selectors
You will see in this guide that you can also use custom selectors without AI when needed.
The main difference is that frozen instructions keep their original definition and can be rolled back to AI when the selector is no longer valid.
On the other hand, custom selectors are never computed by the AI and you must update them manually.
Note that none is better than the other, they are just made to solve different use cases.