Document toolboxDocument toolbox

Creating New Custom Action

You can create new custom in Qualitia from the Develop section. 

Before you start creating custom action:

Ensure you meet following prerequisites before you start creating custom actions in Qualitia.

Creating New Custom Actions

If you have existing set of custom actions which you are using while developing test cases and tasks, you must import them in Qualitia.

For more information on importing existing custom action code in Qualitia, click here.

After you import the existing set of custom actions in Qualitia you can start creating new actions.

For newly created projects, you can start creating custom actions right-away. 

To create new custom action in Qualitia:

  1. Log on to Qualitia Automation Studio.
  2. In the Develop section, click Custom Actions.
  3. Click the   or Create Custom Action button.
    A Custom Actions screen appears.
  4. Select Base Class.

    (warning) 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.
  5. Do one of the following:
    • To add a new Qualitia Class:
      1. Click the Plus button next to Custom Object Class to add a custom object class by mapping to the Qualitia Class that you want to add.
      2. Enter the java class file name without its extension along with the package name (if required), in Qualitia Class.
    • To select a pre-defined Qualitia Class that is mapped to a Custom Object Class:
      • From the Custom Object Class drop-down list, select a pre-defined custom object class.
        The associated Qualitia Class is selected automatically.

    Points to Know

    • For example, if you add a Qualitia Class "com.security.login", then this file creates a package and a java file called as "com.security" and "login.java" respectively.
    • The Custom Object Class is a user-friendly alternate name for a Qualitia Class, which you can specify.




  6. Enter Action Name, Description and Function Name for the action to be created.
  7. In the Properties section, click Add.
    A new line will be added in the grid.
  8. Add Parameter Name, Description, ArgDataType for the parameter, and select whether this parameter is mandatory.
    1. To save the action, click Save.
    2. To save the action and launch the code template in Eclipse IDE, click Save and Launch Eclipse.
  9. Close the Welcome on the IDE window to see your auto-generated custom action code template.
  10. Import the pre-created Custom Action Java project workspace into Eclipse workspace.
    (info) This is a one-time activity for a project.
    1. To import the pre-created workspace, right-click Package Explorer, and select Import from the context-menu.
    2. On the Import window, under the General section, select Existing Projects into Workspace and then click Next.
    3. In the Select root directory section, click the Browse button, select <PROJECTNAME>_QASJavaproject and click Finish.
      You will find this directory under Qualitia project path.



  11. In Eclipse IDE, from the Window menu, select Preferences.
  12. Select General > Workspace > Select Refresh using native hooks or polling.
  13. Click Apply and Close.
  14. 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.
    Note: If you map with a wrong Qualitia Project, the following error message is displayed.

  15. In the editor, add the custom action code in the provided template for your custom action.
  16. Add all the dependent jar files required for your custom actions in the lib folder under <PROJECTNAME>_QASJavaproject (under Qualitia project path).
  17. 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 Qualitia.

Once you have closed the Eclipse IDE, Qualitia automatically commits the code to the version control system (if configured) and makes the code available to other Qualitia project members.