Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Creating a custom action has two steps:is a two step process.

1. Create a Custom Action in VB Script

Create the custom action in VBScript by taking into consideration the custom action rules.

For example, if you want to create custom action as "CustomSetValueInEditBox" for WebEdit, create a new vbs file with name CustomWebEdit. This action will set the specified value into the webedit so method will look similar to below.

Info
iconfalse

Image Added

The first arg is the webedit object as this action will directly perform the action on the edit boxobject. The second arg is of type string which is the value that needs to be set in the edit box. The custom action returns with an integer value.

(info) If the action does not interact with any object then ObjectInfo parameter is not required.

2. Map Customized Action in Qualitia

Once the action is created, you can map the action to Qualitia from the Objects screen.

To map the action with Qualitia:

  1. On the Develop tab, click Objects.
  2. Click the Custom button in the left pane.
  3. Right-click the object class in the left pane against which the custom action is to be mapped.
  4. Select "New" from the context menu.
    An Add New File Name pop up appears.
  5. Enter the name of the vbs file that the custom action is coded into.
  6. Click OK.
  7. Select the custom class just created in the left pane and then click New Custom Action in the right pane.
  8. Enter the following details in the custom vbs file:
    1. Action Name: Name of action as displayed in Qualitia.
    2. Description: Describe what the custom action does 
    3. Function Name:The exact name of the UFT function.
  9. Add the required parameters in the Properties section.

    Info

    (warning) Do not set the object parameter as given in the custom class. The user only needs to add the parameters in the same sequence as given in the vbs file excluding the Object Parameter. Then select the argument data type as String, Integer, or Array. Also, check if the parameter is Mandatory. Deselecting Mandatory option indicates that the parameter is not mandatory, that is zero length string data is allowed.


    Image Added
  10. Once all the parameters are added, click OK.
    The above steps map the custom action to Qualitia.
  11. On the Setting menu, click Configuration Settings > Execution.
  12. In Custom Action Repository Path, enter the path of the vbs file in which you have written the code for custom action followed by a ";" semi-colon.
    For example: D:\CustomLib\CustomWebEdit.vbs;