Custom Operations
The @custom keywords perform the same function as regular keywords.
Input : <object type>; <Visible Text (Optional)> ; <Index>
Note: VerifyExists must be performed on the parent container element before using @Custom Keywords.
Following are the keywords supported in @Custom for the respective object types mentioned:
Click : [‘radiobutton’,’checkbox’,’input',’button’ ,’select’, ‘table’, ’label’],
DoubleClick : [‘radiobutton’,’checkbox’,’input',’button’ ,’select’, ‘table’, ’label’],
GetElementText : [‘radiobutton’,’checkbox’,’input',’button’ ,’select’, ‘table’, ’label’],
GetStatus : [‘radiobutton’,’checkbox’]
GetText : [‘input’],
SelectCheckbox : [‘checkbox’],
SelectRadioButton : [‘radiobutton’],
SetSecureText : [‘input’],
SelectValueByText : [‘select’],
SelectValueByIndex:[‘select'],
SetText : [‘input’],
UnselectCheckbox : [‘checkbox’],
VerifyElementText : [‘radiobutton’,’checkbox’,’input',’button’ ,’select’, ‘table’, ’label’],
VerifyExists: [‘radiobutton’,’checkbox’,’input',’button’ ,’select’, ‘table’, ’label’]
Working of @Custom: Unlike the desktop plugin, we cannot perform verifyExists on any element and expect @custom to work. We should perform verifyExists only on the container element containing the child elements (Note: it need not be the immediate container element). In the below example, the parent container element is usr.
Note: In the example of ABAP Dictionary: Initial Screen, we cannot perform @Custom after we perform verifyExists on the radio button: Database table, as this radio button does not have any child elements to perform the @Custom operation.
We can verify this by viewing the structure of this SAP window in the Tracker tool as shown:
We can see that only the container named usr has child elements. No other element has any children. This format follows for all SAP windows.
We can take another example of this (in Dictionary: Display Table in SE11):
Here, the multiple parent container elements exist. Since we do not need an immediate parent container element, we can perform verifyExists on usr and expect @Custom to work on the elements inside the table: tblSAPLSD41TC0. Vice versa is impossible as the table: tblSAPLSD41TC0 is not the parent container of usr.
We can verify this in the Tracker tool:
We can see that the usr container is the parent of the tabsTAB_STRIP container, which is the parent of the tabpDEF container, and so on.
Keyword: CLICK
Description: This keyword or action instructs Avo Assure Client to click on the object as specified in the input.
Note: The index starts from “1” for Custom Keywords in SAP, and the “verifyExists” step should precede the “@Custom’ test steps.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will click on the first RadioButton of that page. If the output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: DOUBLECLICK
Description: This keyword or action instructs Avo Assure Client to double-click on the object as specified in the input.
Note: The index starts from “1” for Custom Keywords in SAP, and the “verifyExists” step should precede the “@Custom’ test steps.
Find the snippet of the keyword below:
In the above example, after the test case debugs, Avo Assure Client will double-click on the first RadioButton of that page. If the output variable is provided for execution status, “True”/ “False” will be stored.
Keyword: GETELEMENTTEXT
Description: This keyword or action instructs Avo Assure Client to fetch the text of the element/object as specified in the input and save the result in the output variable.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will fetch the text of the second element of that page, and the value will be stored in variable {GET}. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: GETSTATUS
Description: This keyword or action instructs Avo Assure Client to fetch the object's status as specified in the input and save the result in the output variable.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will fetch the status of the second RadioButton of that page, and the value will be stored in variable {GS2}. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: GETTEXT
Description: This keyword or action instructs Avo Assure Client to fetch the object's text as specified in the input and save the result in the output variable.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will fetch the text of the first textbox of that page, and the value will be stored in variable {GS}. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SELECTCHECKBOX
Description: This keyword or action instructs Avo Assure Client to select the checkbox as specified in the input.
Find the snippet of the keyword below:
In the above example, Avo Assure Client will select the first checkbox on that page after the test case debug. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SELECTRADIOBUTTON
Description: This keyword or action instructs Avo Assure Client to select the radio button as specified in the input.
Find the snippet of the keyword below:
In the above example, Avo Assure Client will select the second RadioButton of that page after the test case debug. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SELECTVALUEBYTEXT
Description: This keyword or action instructs Avo Assure Client to select the value from the dropdown according to the text for the list specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will select the value “Persons” in the first dropdown of that page. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SELECTVALUEBYINDEX
Description: This keyword or action instructs Avo Assure Client to select the value from the dropdown according to the index for the list specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will select the value with index 0 in the first dropdown of that page. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SETSECURETEXT
Description: This keyword or action instructs Avo Assure Client to set the encrypted text to the text field as specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will enter the encrypted text to the twentieth textbox of that page. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: SETTEXT
Description: This keyword or action instructs Avo Assure Client to select the value from the dropdown according to the text for the list specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will enter the value “Program” into the first textbox of that page. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: UNSELECTCHECKBOX
Description: This keyword or action instructs Avo Assure Client to unselect the checkbox as specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will unselect the second checkbox of that page. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: VERIFYELEMENTTEXT
Description: This keyword or action instructs Avo Assure Client to verify if the element text on the object is the same as specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debugs, Avo Assure Client will verify if the second element in that page has text as “Text”. If an output variable is provided for execution status, “True”/ “False” will be stored in it.
Keyword: VERIFYEXISTS
Description: This keyword or action instructs Avo Assure Client to verify the object's existence as specified in the input.
Find the snippet of the keyword below:
In the above example, after the test case debug, Avo Assure Client will verify the existence of the second dropdown of that page. If it exists, “True” will be stored. Else, “False” will be stored in the output variable.
Last updated