Header
(v1) Custom Action
Qualitia Automation Studio (QAS) covers most of the actions required for automation testing; however, there might still be a need to add some more actions to QAS based on the project requirements. Qualitia allows you to develop your own actions and make them available to use while automating test cases for the application under test.
The custom action module allows you to develop and maintain these actions in a convenient way.
📚Prerequisites
User should have Custom Action Developer privileges.
Set Eclipse Path under Project Settings.
Create Custom Action
To create new custom action in QAS - Client:
Login to QAS - Client.
Access Develop from left navigation to view Test Explorer screen.
Click Custom Action icon from extreme right of the toolkit. It will open the Custom Action Explorer screen.
When no Custom Action exists, you are prompted to Create Custom Action in the Custom Action viewer section.
Click +Add or Create Custom Action to start creating a new Custom Action.
Clicking Create Custom Action will open Create Custom Action screen with the following options.
Name: Enter an intuitive name for the custom action that is easy to recognize.
Maximum length permitted is 300 characters including spaces.
Description: A brief description about the custom action.
Technology: Select technology as Web or Mobile.
Base Class: Select Base Class from the dropdown menu.
The Custom Object Class file name including its file path should not exceed 256 characters when you are using Git/Bitbucket as a source control system for maintaining project artifacts.Custom Action Class: To add a new Qualitia Class:
Click + Add/Edit Object Class next to Custom Action Class to add a custom object class.
It will open Manage Action Object screen with the following options:
Technology: This will be default and you cannot edit it.
Base Class: This will be default and you cannot edit it.
Custom Action Class: Enter an intuitive name for the custom action class that is easy to recognize.
Qualitia Class: Enter Qualitia class name that is easy to recognize.
Click Save to continue; otherwise, Discard.
From the Custom Action Class drop-down list, select the newly created or a pre-defined custom object class. The associated Qualitia Class will be selected automatically.
Function Name: Enter an intuitive name for the function that is easy to recognize.
Parameters: You can add multiple parameters by clicking +Add next to Parameter. Once done, enter parameter name, select String or Array as per your preference, and check Mandatory as ON/OFF for all the parameters. You can also change the sequence of the parameters by just dragging them up and down.
Click Save and Launch Code Editor to continue; otherwise, Discard.
You will see an Alert - Custom Action window with a message, click OK to launch the Eclipse IDE.
Import the pre-created Custom Action Java project workspace into Eclipse workspace.
This is a one-time activity for a project.To import the pre-created workspace, open Project Explorer, and select Import Project from the context-menu.
On the Import window, select the Maven folder, select Existing Projects into Workspace and then click Next.
In the Select root directory section, click Browse, select <PROJECTNAME>_QASJavaproject and click Finish.
You will find this directory under Qualitia project path.
In Eclipse IDE, from the Window menu, select Preferences.
Select General > Workspace > select Refresh using native hooks or polling.
Click Apply and Close.
Ensure you do not change the method signature and provide only the method body. Changing the signature in code may break your action in Qualitia.
In the editor, add the custom action code in the provided template for your custom action.
To add the dependent jars, do the following in the order listed:
Add the dependent jar files in the lib folder under the project.
Right-click the Project, point to Build Path, and then select Configure Build Path.
Click Libraries > Add JARs.
Under Jar Selection window, expand the Project folder.
Under the lib folder, select the dependent Jar, and click Ok.
Click Apply and Close.
Build the project and close the Eclipse IDE.
To work this custom action code in the Qualitia automation test cases, you must build the project successfully.
You can now use this newly created custom action while developing task and test cases in QAS - Client.
Once you have closed the Eclipse IDE, QAS automatically commits the code to the version control system (if configured) and makes the code available to other Qualitia project members.
💡Golden Nuggets: Best Practices for Custom Action
The parameter data types supported by QAS are String and Array. If an array parameter is used in QAS for the custom action, then custom action parameter should be of the type Object in Custom Action function. The parameter can then be type-casted into the data type which is required in the action.
For example, the object parameter can be type-casted into the array list.Based on the standard Java coding rules, actions should not be created in the default package. For better maintenance, it is recommended to use user-defined packages for development.
It is recommended to put a prefix when defining a name for new custom actions for easy identification.
No two custom actions can have the same function name in the same class. Function overloading is not allowed. Duplicate function names in different classes are allowed (not recommended).
Once the action is mapped into Qualitia and used in a test case, do not change the existing signature or other details of the actions or the classes created. The functionality of the action can be modified. Do not delete the custom actions or custom classes that are used in test cases.
If the custom action belongs to any object type (such as WebEdit, WebElement, and so forth), ensure you add the objectInfo data type parameter while developing the code of an action.
While mapping actions into Automation Studio, it is important to map the action using <package.class> hierarchy.
Objects should be added under appropriate Qualitia classes while mapping custom actions into Qualitia Automation Studio.
📞📚 Here to Help: Support and Resources
If you have questions that are not addressed in the documentation, you may raise them in the Qualitia Community.
Footer