Availability: Release 5.0
Library Action is a general-purpose Action that has no contextual relevance. It can be used anywhere in a Scenario and any Action can call this Action. Not only that you can insert a Library Action anywhere in a Scenario, but it also has no effect on what steps can follow it.
A Library Action cannot include statements to interact with UI (web, mobile, TE, desktop, etc.) and cannot reference any UI Elements.
Library Actions are typically best suited for non-UI test functions such as API, Database, Message Queue, etc. where you achieve modularity, but at the same time, the Action does not impose any contextual restrictions.
Example for Library Action
Consider the following Action,
Verify account balance in Database
This Action fetches balance for various accounts from the backend database and verifies as expected. It may be called in a Scenario flow right after the Login, before the balance transfer, after the balance transfer, or anywhere else. It is said to have no contextual relevance.
Marking an Action as Library Action
You can mark an Action as Library Action either during the creation of an Action or later by editing the flag in the Action entity.
When creating an Action, select the check box displayed alongside the Destination Context. Destination Context is not applicable when you are marking an Action as Library Action, and hence the dropdown is disabled.
You may also change an Action to Library Action after it is created. Navigate to the "Applicability" tab in the sidebar of the Action and select the Library Action option. Note that converting an existing Action to a Library Action has a change impact. The operation may fail if the Action logic consists of any UI interaction/verification statements or if the logic is referring to UI Elements.
When a non-library Action is converted to a Library Action, its Destination context changes (and becomes n/a). If you have a Scenario using this Action, then the steps following the current Action may be impacted if there is a missing-step sequence. Learn more about missing steps.
Inserting Library Action in Scenario
When adding a step in a Scenario, all Library Actions are displayed in the Relevant tab all the time. You can pick a Library Action to insert at any step in the flow.