We started with Omnis and will be working with many other IDEs in the future. Also – if you have developed your own custom elements, this will open the door to automated testing!
Why Automated Testing Tools Don’t Work With Custom Elements
Automated testing tools work with the window manager to locate and recognize application elements such as Edit Fields, PopupLists and PushButtons. On Microsoft Windows, most applications contain elements that are derived from Microsoft Foundation Classes (MFC). Testing tools recognize the class of those elements and can anticipate how they will function. For example, PopupLists are known to contain a list of items from which an item can be selected.
For many different reasons, custom elements have been developed to supplement the standard set of element classes. In some cases a feature might be required that is not provided by a standard element. In others, including application builders such as Delphi, Omnis and PowerBuilder, a set of custom elements are provided to allow applications to be built without requiring advanced development skills. There is a multitude of companies that offer third-party grids, navigators, tables, toolbars, etc. that can be integrated into software applications and there are plenty of home-grown widgets as well. Regardless of the source of the custom elements, they pose a challenge for test automation because their interfaces are unknown.
Some app vendors like PowerSoft recognized the limitation and created a TestAPI to enable test automation, but that is the rare exception. Ambitious testers have attempted to use the low level mouse and keyboard events that most testing tools can but the resulting, tests are fragile and difficult to maintain at best. Note: AscentialTest already supports automated testing for web, .net, PowerBuilder, Delphi, Terminal etc., but Omnis is the anchor IDE for which we built this great custom element extension test kit. But this kit can be applied to any IDE with custom elements, which then allows automated testing. In sum, if your IDE requires substantial customization or manual testing, our Custom Element Extension Kit is the only way to provide true automated testing for these custom elements.
How the New AscentialTest Extension Kit Enables Testing Support for Custom Objects
Because we understand the need for test automation and the lack of available options for custom elements, Zeenyx has embraced the opportunity to provide a way for organizations to expose the attributes of those elements so that an automated testing solution is possible.
With the release of AscentialTest v 9.5, Zeenyx announces the availability of a free Custom Element Extension Kit. Through a series of messages between AscentialTest and the target application, the attribute values of custom elements are made available to the testing agent.
To implement the extension kit, the target application is modified to respond to messages sent from the testing agent by sending back a json strings containing attribute values. The level of effort to implement the extension kit is minimal. Here are a few sample messages:
The Capture Object message establishes the class of the custom element. It is implemented once for each custom element class:
Message Zeenyx.CaptureObject
Parameters (none)
Returns JSON string
{
“Name”: “”,
“Class”: “”,
}
There is a subsequent message for each custom element class. Here is the message for a custom popuplist:
Message Zeenyx.CapturePopupList
Parameters (none)
Returns JSON string
{
“SelectIndex”: 0,
“SelectText”: “”,
“Text”: “”,
“Items”: [
{
“Text”: “”,
“Rect”: “”
}
]
}
For this element, the target application provides the index and text of the selected item along with a list of the text and rectangles of the items contained in the list.
The current list of supported custom element classes includes: Breadcrumb, CheckBox, ComboBox, DropdownList, Grid/Table, ListBox, ListView, Menu/MenuItem, PopupList, PushButton, RadioButton, StaticText, TabGroup, TextField, Toolbar, TreeList. If you have an element class that is not listed, just tell us about the requirements and we will construct the appropriate message for you.
Real World Example: Omnis Studio
Omnis Software approached Zeenyx to inquire whether it was possible to provide automated testing support for their customers. The Omnis application is comprised entirely of custom classes. The image below displays the view of the target application prior to implementing the extension kit:
![](https://www.zeenyx.com/wp-content/uploads/2024/07/word-image-10712-1-1.png)
The Elements Panel on the left confirms that AscentialTest does not recognize the class of any of the elements that comprise the sample dialogbox. Each element is listed only as ‘OMNIS_CHILD’, which is the Windows class of the element.
Compare to the image below which displays the Elements Panel after the extension kit was implemented:
![](https://www.zeenyx.com/wp-content/uploads/2024/07/word-image-10712-2-1.png)
The Elements Panel confirms that AscentialTest recognizes all of the elements that comprise the sample dialogbox. Once the extension kit is implemented for a custom element, AscentialTest recognizes and interacts with the element as if it were a standard Microsoft element.
How to: Implementing the Extension Kit
Zeenyx offers the extension kit free of charge. The level of effort to implement a custom element class varies from a few minutes to a few hours, depending on the complexity of the element. Here is what Andrei Augustin of Omnis Software said about implementing the extension kit:
“The level of effort required to implement the messages for a custom element has been relatively straightforward, thanks to the capabilities of AscentialTest software. AscentialTest sends messages directly to our Window procedures, which means our main task was to parse our existing structures into a simple JSON format to inform AscentialTest of the contents. For the simplest controls, this exercise was trivial. Basic components required minimal effort to parse and format into JSON, allowing us to quickly integrate them with AscentialTest. However, for more complex elements, such as lists, the process was slightly more involved. These components required additional parsing logic to ensure all necessary data was accurately represented in the JSON format. Overall, the collaboration between Zeenyx and Omnis has significantly smoothed out the implementation process. Many of the initial challenges have been addressed, setting a clear path for those who follow. We believe this streamlined approach will greatly benefit anyone looking to expose their custom elements to AscentialTest.”
If you are interested in learning more about the Custom Element Extension Kit or would like a free copy, please contact us at [email protected].