Now, we can create an icon for our operation. This icon will be displayed next to the operation name in the operations palette and in tests.
The icon must be a 16×16 BMP or PNG file with the 24-bit or lower color depth. The color of the lowest left pixel is treated as the “transparent” color.
To create a bitmap or PNG, you can use any graphic editor, for example, MSPaint.
Right-click the image and select Copy from the context menu
You can copy the image from this topic:
Right-click the image on the right and select Copy from the context menu. This will copy the image to the clipboard.
Switch to a graphic editor and paste the copied image to it.
Save the image under the la-icon.bmp name to the C:\My Extensions\LogAttrExtension folder (that is, to the folder that contains the description.xml file).
Let’s add information about the icon to the description file. For this, we need to add the Icon attribute to the KDTOperation element corresponding to our custom operation and specifying the icon’s file name as the attribute value:
Open the C:\My Extension Files\LogAttrExtension\description.xml file in your text or XML editor.
Add the following text to it:
<?xml version = "1.0" encoding = "UTF-8"?>
<Category Name = "Keyword Test Operations">
<ScriptExtension Name = "Log Attributes Keyword Test Operation" Author = "SmartBear Software" Version = "1.0 test" HomePage = "smartbear.com">
<Description>Provides the Log Attributes keyword test operation.</Description>
<Script Name = "laCode.js">
<KDTOperation Name = "Log Attributes" Category = "Logging" Icon = "la-icon.bmp">
<!-- General properties -->
<Field Name = "Description" />
<!-- Log Attributes object properties -->
<Field Name = "FontColor" />
<Field Name = "BackColor" />
<Field Name = "Bold" />
<Field Name = "Italic" />
<Field Name = "Underline" />
<Field Name = "Strikeout" />
<Field Name = "PlainTextRemarks" />
<Event Name="OnCreate" Routine="LogAttr_OnCreate"/>
<Event Name="OnExecute" Routine="LogAttr_OnExecute"/>
Save the changes.