An Action is a reusable block of logic that achieves a meaningful test function. Consider the following examples:
- You may have an Action "Login to QBank" which interacts with your web application and automatically performs Login on the page.
- You may have an Action "Get current balance from DB", that connects to a database and executes a query to return the Account balance of a user.
Applicability of an Action
If you recall, an Action may be used as a Step in a Scenario or may be called from other Actions. There are certain rules that govern how/where an Action can be used.
- Where a given Action can be used in a Scenario flow?
- Which Actions can call a given Action?
- What steps can follow a given Action in a Scenario?
Collectively these restrictions define what is called contextual relevance or applicability of an Action.
Where in a Scenario can an Action be used?
Configuring the Applicability of an Action
Open the Action in ACCELQ, and click on the "Applicability" tab in the sidebar.
There are multiple attributes, as described below to configure applicability.
Attributes influencing the applicability of an Action (Contextual relevance)
Visible for Scenario
This flag determines if this Action is displayed while building a Scenario. If this flag is turned off, this Action cannot be used in a Scenario. You typically turn off Scenario access to those Actions which are meant to be used only in other Actions to achieve modularity in logic design. Here is a detailed article about this flag.
Init Action
When an Action is marked as Init Action, you may use it as a starting point (first step) in a Scenario. This typically includes logic for invoking the browser or the application. Learn more about Init Actions.
Available from Contexts (Shared Contexts)
An Action may be defined in one Context (owner Context), but it may be relevant in other Contexts also. For example, Logout from QBank Action may be valid from either the Home Page or the Profile Page. You can mark this Action as "Available" from both Home Page and Profile Page Contexts. When you are building a Scenario, this Action will then show up as relevant when the flow is either in the Home Page or Profile Page.
Similarly, this Action will show as part of "call Action" in all the Actions which belong to either the Home Page or the Profile Page. Other restrictions may apply based on the Destination Context described below.
Learn more about sharing of Actions.
Destination Contexts
This is the Context where your application will land as a result of running an Action. For example, Login to QBank which is run in the Login Page of your application may land the application in the Home Page. Destination Context determines which steps are relevant after this step in a Scenario. For the above example, all the Actions from Home Page will be relevant in the Scenario after the Login step.
This Action may be called in other eligible Actions (based on the Available from flag) only if the Destination Contexts are matching between the two Actions.
You may configure Destination Context in multiple ways. Here is an article about it.
Library Action
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.
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.
You can mark an Action as a Library Action which implicitly controls some of the flags described in this article.
- Init Action: Since a library Action can be used anywhere in a Scenario, this flag becomes irrelevant.
- Available From: A library Action is implicitly "available" from every Context in the project.
- Destination Context: Since a library Action does not influence what steps can follow this step, Destination Context is not defined.
Here is an article with detailed description of Library Action.
Comments
0 comments
Please sign in to leave a comment.