It Starts with Recognition of the DataWindow
As the PowerBuilder community knows, the datawindow is the foundation of all PB applications. It can be rendered in an array of presentation styles including Composite, CrossTab, Form, Grid, Group, Label, N-Up, Tabular or Tree. It’s a complex windows element that presents data stored in an underlying database. Its data cells can contain any element type, including but not limited to PopupLists, RadioLists, Static Text, Edit Fields, etc.
Those Pesky Record Location Changes
The dynamic nature of the datawindow provides a challenge for automated testers. The relative location of a record changes as data is modified through the application under test (AUT). Running a test that adds a new data entity to the database can change the row position of any other record.
The PowerBuilder Community Asks Us To Create an Extension
Because of the challenges they faced using existing testing tools with the Datawindow, a group of organizations who use PowerBuilder reached out to us a decade ago and asked whether we would consider building a PowerBuilder extension. They expressed frustration with trying to automate a complex element by using images and keystrokes to blindly navigate through the constantly changing datawindow grid. Smartbear claims to have had support for PowerBuilder at one time but it appears that reached End of Life with PowerBuilder 12.
Working with Sybase
Upon receiving the request, we contacted Sybase, then recently acquired by SAP, and found that they were more than happy to help us by providing access to software, documentation and technical support. We also found that the TestAPI had been well designed and is quite compatible with our approach to object recognition. As far as we know, we are the only testing tool vendor that embraced the TestAPI which continues to be maintained today by Appeon.
The Challenge For Existing Testing Tools
It is certainly possible to use workarounds to create test automation for the datawindow using tools like Ranorex, Test Complete or Tosca. One approach is to position the cursor in the first cell of the first row in the table. With that cell location as an anchor point, any other cell in the table can be reached with a series keystrokes like <DOWN> and <TAB>. Once the cursor is positioned in the cell, its value can be captured or modified. To get the value of the cell, send the keystroke combination ‘<Ctrl-a><Ctrl-c>’ to copy the text in the cell to the clipboard, from which it can be retrieved and verified. If the objective is to edit the value of a cell, send the keystroke combination <Shift-End-Delete> to remove the current text and then send the keystrokes to input the text of the new value. The limitation to this approach is that it assumes that the target cell will be in the same relative location at runtime as it was when the test was created. If a record is removed or added and the row number of the target row has changed, then the test will need to be modified to reflect the new position.
The Only Testing Tool Recommended by Appeon
By hooking into the PowerBuilder TestAPI at runtime, AscentialTest has built-in object recognition for all of the components of the data window, regardless of its complexity and dynamic nature. The foundation of AscentialTest object recognition is our patented ‘Snapshot technology’, a smart image which displays a document-object-model of object hierarchy and attributes. The image below displays a snapshot of a data window in the form of what we call a PbTable.
Notice that AscentialTest recognizes the rows, columns and elements in each cell. AscentialTest provides a special feature called a ‘selector’, which makes it easy to locate a row in a table based on a target value. In the example above, the selector has located the second row in the table because it contains the test value ‘Triggers and stored procedures”. The selector will find the row at runtime regardless of its position in the table, even if it needs to scroll the row into view.
AscentialTest Table Interface
In addition to datawindow recognition, AscentialTest provides a table interface that allows the user to easily verify, select and set table elements in the AUT. Through interacting with the ‘Actions Panel’ and drag and drop, the following types of test actions are automatically generated:
- Verify the contents of a table
- Verify the contents of a row
- Verify the contents of a column
- Get the number of rows
- Get the number of columns
- Select a row/column
- Set the value of an element embedded in a column (TextField, PopupList, RadioList, etc.)
Here are a few examples:
The image below depicts a snapshot of a PbTable with customer information.
Verifying the contents of a row
To verify the contents of a row, all the user needs to do is select the ‘Verify’ radio button in the Actions Panel along with the ‘Values’ property. The row can be specified using a row index or string selector:
AscentialTest auto-generates the test action:
Selecting a row/column in a table
To select a column in a row, the user selects the ‘Event’ radio button in the Actions Panel and specifies the row using either an index or string selector.
AscentialTest auto-generates the test action:
Setting the value of a control embedded in a table cell
Table cells often contain input elements like TextField, PopupList, RadioList, etc. The example below displays a PbTextField inside of a PbColumn in a PbTable:
To set the value of an input element in a table cell, the user selects the ‘Set’ radio button in the Actions Panel and specifies the row using either a selector or an index.
AscentialTest auto-generates the test action:
It’s that easy!
Comprehensive Support for All Things PowerBuilder
AscentialTest provides comprehensive automated testing support for all the components of a PowerBuilder application including the database, using our built-in ODBC driver, Rest and embedded GUI components including DotNet (Winforms or WPF) and web pages using Chrome or Edge (MSWebview2). AscentialTest provides PowerBuilder automated testing support for applications from PB v6.x right up to the most current version of Appeon PowerBuilder.
Cross-platform tests for PowerBuilder, PowerServer and PowerClient
Whether your application is running from within the PowerBuilder IDE, deployed as a windows client or through PowerServer or PowerClient, your automated tests will run without change in any of these environments – one set of tests across all of your PowerBuilder platforms.
Due Diligence
If you are using a testing tool for PowerBuilder that does not utilize the TestAPI or were not aware that a PowerBuilder testing tool was available, check out the reviews from some of our customers on Gartner Peer Insights and consider starting a free AscentialTest trial.
Start a 6-Month Free Trial