...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Working with Custom Actions for Web and Mobile Projects
...
Table of Contents |
---|
Introduction
Though Qualitia covers most of the actions required for automation testing, there might still be a need to add some more actions to Qualitia 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.
This module provides:
A guided and easy to follow guidelines to develop custom actions,
Make code templates, required dependencies, and sample codes easily available to anyone who can create custom actions,
Maintain the custom action code just like you maintain tasks and test cases using a version control tool like SVN or Git, and
Share these custom actions with other project members for use.
Working with Custom Actions for Web and Mobile Projects
After you import all your existing custom actions in Qualitia, you can now create, modify, search, or view the custom action codes in Qualitia automation studio itself. In the cases of multi user scenario, you can share these actions easily with other team members just as you share your tasks and test cases.
Also, any of the project members can update the code using an Eclipse IDE based on the requirements. You can launch an Eclipse IDE from Qualitia automation studio itself.
Importing Existing Custom Actions Created in Previous Qualitia Versions
If you have created custom actions using a Qualitia version before v7.0.0, then you can import your existing set of custom actions into Qualitia. Importing custom actions is simple 3 step process.
Expand | ||||
---|---|---|---|---|
| ||||
In order to import and streamline the custom actions with other project data in Qualitia, you must add all the java source files at one place. In case you do not have source files for some actions, you can generate the source code files easily using these commands mentioned below.
|
Expand | ||
---|---|---|
| ||
To create and compile custom action project:
|
Expand | ||
---|---|---|
| ||
You can import the existing set of custom actions in Qualitia to share with the other project members easily. Ensure the class files you are providing have all the custom actions functions present for which you have provided the metadata. A single class file can contain functions for multiple custom actions.
|
...
Creating a Custom Action for a Web/Mobile Project
Pre-Requisites
...
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 Project Settings
Add multiple jar files under Project Settings
Creating New Custom Actions
From
the Expandthe Expand Menu, click Develop.
Click
the Customthe Custom Actions tab.
Click the Add Button ( )
or Createor Create Custom Action button.
The 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.Info title 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.
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 Customthe pre-created Custom Action Java project
workspace intoworkspace 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,
selectselect Existing Projects into Workspace
andand 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 >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 infiles 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,
selectselect 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 Qualitia.
Info |
---|
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. |
...
Info |
---|
Re-importing this java project is mandatory. Else, the user will not be able to access updated custom actions. This is a one-time activity. |
Ensure you clone all the project data to the new directory.
This includes Test cases, Tasks, Custom actions, and Java project folders (which hold all the latest custom action code).Remove the existing project from the workspace.
To import the cloned java project from the new directory, 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.
This is in the new directory where you have cloned the Qualitia project data.Select General > Workspace > Select Refresh using native hooks or polling.
Click Apply and Close.
Custom Action Custom Files are Not Pushed to Project Path GIT Repository
Open the Eclipse Project.
Click Windows > Preferences > Teams > Git > Projects.
In the right side of the Preference dialog box, under Projects, deselect the Automatically ignore derived resources by adding them.gitignore checkbox.
Other Validations
Validation Error | Resolution |
---|---|
.classpath |
file is not present |
in your Eclipse project location | Ensure that the Eclipse project was built successfully after adding all required artifacts (lib, bin, |
src folders) to it. This will create a .classpath |
file. |
.class files are |
not present in your Eclipse project location | Collect the |
required compiled .class |
files and add them to the Eclipse project (under bin folder). Names of the required files is mentioned in the report. |
Jar files mentioned |
in .classpath |
in your Eclipse project location | Collect all |
the required jar files and add them to your Eclipse project directory (under lib folder). |
Java source files are not |
present in your Eclipse project location | You need to generate the source code from the compiled class files and add them into the src folder under Eclipse project directory. For more information on the creating the source files, refer to the (8.3.0 2) Importing Existing Custom Actions Created in Previous Qualitia Versions section. |
Once you have fixed all the errors mentioned above, you can continue importing custom actions in Qualitia.
Working with Custom Actions for Desktop Projects
...
Expand | |||||
---|---|---|---|---|---|
| |||||
In order to import and streamline the custom actions with other project data in Qualitia, you must add all the java source files at one place. In case you do not have source files for some actions, you can generate the source code files easily using these commands mentioned below.
|
Expand | ||
---|---|---|
| ||
To create and compile custom action project:
|
Expand | ||
---|---|---|
| ||
You can import the existing set of custom actions in Qualitia to share with the other project members easily. Ensure the class files you are providing have all the custom actions functions present for which you have provided the metadata. A single class file can contain functions for multiple custom actions.
|
...
Creating a Custom Action for a Web/Mobile Project
Pre-Requisites
...
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 Project Settings
Add multiple jar files under Project Settings
Creating New Custom Actions
From
the Expandthe Expand Menu, click Develop.
Click
the Customthe Custom Actions tab.
Click the Add Button ( )
or Createor Create Custom Action button.
The 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.Info title 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.
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 Customthe pre-created Custom Action Java project
workspace intoworkspace 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,
selectselect Existing Projects into Workspace
andand 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 >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 infiles 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,
selectselect 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 Qualitia.
Info |
---|
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. |
...
Info |
---|
Re-importing this java project is mandatory. Else, the user will not be able to access updated custom actions. This is a one-time activity. |
Ensure you clone all the project data to the new directory.
This includes Test cases, Tasks, Custom actions, and Java project folders (which hold all the latest custom action code).Remove the existing project from the workspace.
To import the cloned java project from the new directory, 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.
This is in the new directory where you have cloned the Qualitia project data.Select General > Workspace > Select Refresh using native hooks or polling.
Click Apply and Close.
Custom Action Custom Files are Not Pushed to Project Path GIT Repository
Open the Eclipse Project.
Click Windows > Preferences > Teams > Git > Projects.
In the right side of the Preference dialog box, under Projects, deselect the Automatically ignore derived resources by adding them.gitignore checkbox.
Other Validations
Validation Error | Resolution |
---|---|
.classpath |
file is not present |
in your Eclipse project location | Ensure that the Eclipse project was built successfully after adding all required artifacts (lib, bin, |
src folders) to it. This will create a .classpath |
file. |
.class files are |
not present in your Eclipse project location | Collect the |
required compiled .class |
files and add them to the Eclipse project (under bin folder). Names of the required files is mentioned in the report. |
Jar files mentioned |
in .classpath |
in your Eclipse project location | Collect all |
the required jar files and add them to your Eclipse project directory (under lib folder). |
Java source files are not |
present in your Eclipse project location | You need to generate the source code from the compiled class files and add them into the src folder under Eclipse project directory. For more information on the creating the source files, refer to the (8.3.0 2) Importing Existing Custom Actions Created in Previous Qualitia Versions section. |
Once you have fixed all the errors mentioned above, you can continue importing custom actions in Qualitia.
Modifying Custom Actions
Modify Custom Action Metadata
Info |
---|
For custom actions that are added to a task or a test case, you can update only the Mandatory status of its parameters and no other metadata |
From the Expand Menu, click Develop.
Click the Custom Actions tab.
In the left pane, click the desired custom action which you want to update.
Custom action details will appear in the right pane.Click Edit.
Update Action Name, Description, Function Name, and parameters details based on the requirements.
Click Save and Launch Editor.
Info For desktop project custom action developed in VB, you cannot add or remove parameters from the mapped function for an unused cutsom action from Qualitia client. To work around this issue, launch the associated VBS file from Qualitia client, add or remove parameters for the mapped function, and remap the function to the custom action from Custom Action window.
Modify Custom Action Code
Info |
---|
Ensure that your associated role is assigned with Custom Actions privileges. While editing, it is strongly recommended to view and edit custom actions code from Qualitia Automation Studio only. In case you want to edit multiple custom actions, you must launch the code for each action differently from the automation studio. Modifying multiple actions in a single go may put you in conflicting situations which are difficult to handle. |
From the Expand Menu, click Develop.
Click the Custom Actions tab.
In the left pane, select the desired custom action which you want to update.
Custom action details will appear in the right pane.Click View Code.
The code appears in the different section.To update the code in the Eclipse IDE, click Edit Code.
The code template with an existing code opens in the Eclipse IDE.Update the code based on the requirements.
Build the project and close Eclipse IDE.
Once you close the Eclipse IDE, Qualitia automatically commits the code to the version control system like Bitbucket or SVN (if configured) and makes the code available to other Qualitia project members.
Deleting Custom Actions
Info |
---|
Ensure that your associated role is assigned with the Custom Action Developer privilege. |
From the Expand Menu, click Develop.
Click the Custom Actions tab.
Search the desired custom action.
Select the action in the left pane.
Custom action details will appear in the right pane.Click Delete.