The Link Action lets you share sections of your Virtual Users. You can make any Container into a Test Fragment. Fragments can then be reused through a Link action anywhere inside the project. This way you can reduce the maintenance time, for instance if you have 5 virtual users all doing a login, using a Link action you only have to maintain a single centralized Fragment.
It is important to differentiate:
- Test Fragment: A former Container of one of your virtual users that has been transferred into a Test Fragment Virtual User. It cannot be executed by itself.
- Link action: A pointer to a container inside a Test Fragment Virtual user.
It is recommended to avoid using Link actions inside Test Fragments; otherwise this may lead to cyclic dependencies that cannot be resolved.
Move as link¶
The easiest way to create a Test Fragment is to transform existing nodes of your virtual user, simply select if you want to place it in an existing Fragment VU or create one:
Only container nodes can be converted.
Create Fragment VU¶
The other option is to create a Fragment VU from the Virtual users page. After that you can copy/paste content in it from other virtual users or simply create it using the design page.
Create Link action¶
Simply select the action to be replayed in this link. You can pick any container from any Fragment Virtual user. But it is only possible to select one at a time for a given link. If you need to select another one, please add another link action or merge the containers into another one inside the Fragment Virtual User.
Open Linked Action allows you to access this particular Action inside the Fragment Virtual user.
Fragments can be used to merge statistics from several virtual user profiles into one. This way you can have only one entry for your login in the result table instead of one per virtual user.
When a virtual user is executed every link action will point to the corresponding action inside a Fragments virtual user:
When you execute a Validate Virtual User, the result of each link action is available from inside its fragment.
However, since a fragment can have several results from several validations, you must use the Open Linked Action button from inside the Link configuration screen to open the Fragment and display the result from this VU validation.
When using links within links, cyclic dependencies can happen, since they could lead to infinite loops, we detect them before the script is executed and they must be fixed.
When you run a virtual user validation, the sanity check will detect these issues. Use the inspect button to be directed to the issue and fix it.
For example we can clearly see that this link is referencing himself, this behavior must be changed before proceeding with a test:
Importing from JMeter¶
Link actions are automatically created upon importing a JMX that contains either a module controller or an include controller.