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.
- Eclipse IDE for Java Developers (Version 2019-03 recommended)
- JDK version 1.8 and JRE version 1.8
Both JDK and JRE are bundled with the above Eclipse IDE version. - Custom Action Developer privileges in Qualitia
- Set Eclipse Path under Qualitia Configuration Settings
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:
- Log on to Qualitia Automation Studio.
- In the Develop section, click Custom Actions.
- Click the or Create Custom Action button.
A Custom Actions screen appears. - Select Base Class.
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. - Do one of the following:
- To add a new Qualitia Class:
- 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.
- 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.
- To add a new Qualitia Class:
- Enter Action Name, Description and Function Name for the action to be created.
- In the Properties section, click Add.
A new line will be added in the grid. - Add Parameter Name, Description, ArgDataType for the parameter, and select whether this parameter is mandatory.
- To save the action, click Save.
- To save the action and launch the code template in Eclipse IDE, click Save and Launch Eclipse.
- Close the Welcome on the IDE window to see your auto-generated custom action code template.
- 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, right-click Package Explorer, and select Import from the context-menu.
- On the Import window, under the General section, select Existing Projects into Workspace and then click Next.
- 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.
- 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.
Note: If you map with a wrong Qualitia Project, the following error message is displayed. - In the editor, add the custom action code in the provided template for your custom action.
- Add all the dependent jar files required for your custom actions in the lib folder under <PROJECTNAME>_QASJavaproject (under Qualitia project path).
- 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.