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 | ||
---|---|---|
| ||
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.
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:
- On the Develop tab, click Objects.
- Click the Custom button in the left pane.
- Right-click the object class in the left pane against which the custom action is to be mapped.
- Select "New" from the context menu.
An Add New File Name pop up appears. - Enter the name of the vbs file that the custom action is coded into.
- Click OK.
- Select the custom class just created in the left pane and then click New Custom Action in the right pane.
- Enter Action Name, Description and Function Name as given in the custom vbs file.
Add the required parameters in the Properties section.
Info 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 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.
- Once all the parameters are added, click OK.
The above steps map the custom action to Qualitia. - On the Setting menu, click Configuration Settings > Execution.
- 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;