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 QSA 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📚Prerequisites
User should have Custom Action Developer privileges.
Set Eclipse Path under Project Settings.
Recommended Eclipse versions: 2023-12 (4.30.0) and 2024-03 (4.31.0).
Recommended Java versions: 11, 17, and 21.
Info |
---|
For Custom Action settings, refer https://qualitia.atlassian.net/wiki/spaces/QASNew/pages/34857453839/Project+Configuration#Custom-Action. |
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.
Go to Windows > Preferences > Maven and enable Update Maven Project on start up option.
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.
...
.
💡Golden Nuggets: Best Practices for Custom Action
...