Header

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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:

  1. Login to QAS - Client.

  2. Access Develop from left navigation to view Test Explorer screen.

  3. Click Custom Action icon from extreme right of the toolkit. It will open the Custom Action Explorer screen.

  4. When no Custom Action exists, you are prompted to Create Custom Action in the Custom Action viewer section.

  5. Click +Add or Create Custom Action to start creating a new Custom Action.

  6. Clicking Create Custom Action will open Create Custom Action screen with the following options.

    1. Name: Enter an intuitive name for the custom action that is easy to recognize.

      1. Maximum length permitted is 300 characters including spaces.

    2. Description: A brief description about the custom action.

    3. Technology: Select technology as Web or Mobile.

    4. Base Class: Select Base Class from the dropdown menu.
      (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. Custom Action Class: To add a new Qualitia Class:

      1. Click + Add/Edit Object Class next to Custom Action Class to add a custom object class.

      2. 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.

      3. Click Save to continue; otherwise, Discard.

      4. 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.

    6. Function Name: Enter an intuitive name for the function that is easy to recognize.

    7. 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.

    8. Click Save and Launch Code Editor to continue; otherwise, Discard.

  7. You will see an Alert - Custom Action window with a message, click OK to launch the Eclipse IDE.

  8. 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, open Project Explorer, and select Import Project from the context-menu.

    2. On the Import window, select the Maven folder, select Existing Projects into Workspace and then click Next.

    3. In the Select root directory section, click Browse, select <PROJECTNAME>_QASJavaproject and click Finish.
      You will find this directory under Qualitia project path.

  9. In Eclipse IDE, from the Window menu, select Preferences.

  10. Select General > Workspace > select Refresh using native hooks or polling.

  11. Click Apply and Close.

  12. 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.

  13. In the editor, add the custom action code in the provided template for your custom action.

  14. To add the dependent jars, do the following in the order listed:

    1. Add the dependent jar files in the lib folder under the project.

    2. Right-click the Project, point to Build Path, and then select Configure Build Path.

    3. Click Libraries > Add JARs.

    4. Under Jar Selection window, expand the Project folder.

    5. Under the lib folder, select the dependent Jar, and click Ok

    6. Click Apply and Close.

  15. 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.

  • No labels