Components, which can also be referred to as methods, are reusable chunks of actions designed to reduce having to repeat yourself. Some common use cases for components are:
There are many other use cases for components, and as you create tests, ask yourself, "What parts of this test will be used again?". Under the hood, components are essentially just special snaptests, so they can do everything a normal test can do, such as using variables, being played back, and being debugged, etc. The only difference is that they can be called as a test action from within another test:
It's quite easy to make a new component:
When you create a component (and a test for that matter), the variables you define are considered the "default variables" that may be overidden by instance variable.
In the case of components, you can override these variables using "instance variables". They do not change the default variables, but just replace them in the current instance: