Genero BDL API for GGC

The Genero BDL API for the GGC provides types, functions, and methods for generating or writing tests in Genero BDL.

Import the API

The ggc.42m module in the GGCDIR/lib/ directory defines the API. To implement it in your test, you need to add the instruction IMPORT FGL ggc to your Genero BDL test module.

Table 1. Genero Ghost Client - BDL Types
Types Description
PUBLIC TYPE FrontCallAnswer RECORD
    type STRING,
    status STRING,
    errorMessage STRING,
    returnValues DYNAMIC ARRAY OF RECORD
        isNull BOOLEAN,
        value STRING,
        index INTEGER,
        dataType STRING
    END RECORD
END RECORD
The FrontCallAnswer type defines a record for retrieving the result of a front call.
PUBLIC TYPE FrontCallRequest RECORD
    frontCall RECORD
        moduleName STRING,
        functionName STRING,
        paramCount INTEGER,
        returnCount INTEGER,
        parameters DYNAMIC ARRAY OF RECORD
            dataType STRING,
            isNull BOOLEAN,
            value STRING
        END RECORD
    END RECORD,
    errorMessage STRING
END RECORD
The FrontCallRequest type defines a record for retrieving front call request details.
PUBLIC TYPE Message RECORD
    isErrorMessage INTEGER,     
    message STRING              
END RECORD
The Message type defines a record for retrieving errors and messages.
PUBLIC TYPE Statistics RECORD
    sessionId STRING, 
    bytesSent STRING,
    bytesReceived INTEGER,
    scenarioCount INTEGER,
    scenarioFailed INTEGER,
    downloadCount INTEGER,
    downloadFailed INTEGER,
    downloadBytes INTEGER,
    sessionDuration RECORD
        startTime BIGINT,
        endTime BIGINT
    END RECORD,
    downloadFailures DYNAMIC ARRAY OF STRING,
    errors DYNAMIC ARRAY OF RECORD
        status STRING,
        detailMessage STRING
    END RECORD,
    checkFailures DYNAMIC ARRAY OF RECORD
        fileName STRING,
        lineNo INTEGER,
        message STRING
    END RECORD
END RECORD
The statistics type defines a record for retrieving test result statistics.
Table 2. Functions testing actions and keys
Function Description
action(
   name  STRING )
Execute an action by name.
key(
  name  STRING )
Send a key by name.
Table 3. Functions for interacting with simple form fields
Function Description
setFieldValue(
   fieldName STRING,
   value  STRING )
Set value in a form field.
setFocus(
   fieldName   STRING )
Set focus on a field.
setValue(
   value  STRING )
Set value in the current field.
Table 4. Functions for interacting with tables
Function Description
getColumnValue(
   tableName  STRING,
   columnName STRING,
   row  INTEGER )
  RETURNS STRING
Get the column value of a table, tree, or screen record at the specified row.
getColumnValues(
   tableName  STRING,
   columnName STRING )
  RETURNS DYNAMIC ARRAY OF STRING
Get column values of a table, tree, or screen record.
hideTableColumn(
   tableName  STRING,
   columnName  STRING )
Hide a table column.
setCellFocus(
   tableName  STRING,
   columnName  STRING, 
   row  INTEGER)
Select a cell in a table.
setRowFocus(
   tableName  STRING,
   row  INTEGER)
Select a table row.
setRowSelection(
   tableName STRING,
   selectionMode STRING,
   startIndex INTEGER,
   endIndex INTEGER)
Update a multiple row selection state.
setTableOffset(
   tableName  STRING,
   pageSize   INTEGER )
Set the table page size offset value.
setTableSize(
   tableName  STRING,
   size  INTEGER )
Set the table size.
showTableColumn(
   tableName  STRING,
   columnName    STRING )
Show a hidden table column.
sortTable(
   tableName  STRING,
   columnName  STRING, 
   sortType STRING)
Sort a table.
Table 5. Functions for interacting with tree views
Function Description
collapseTree(
   treeName STRING,
   row INTEGER )
Collapse a node (row) in a tree view.
expandTree(
   treeName STRING,
   row INTEGER )
Expand a node (row) in a tree view.
Table 6. Functions for retrieving information and data
Function Description
getFieldValue(
  fieldName STRING)
  RETURNS STRING 
Return the value in a specified form field.
getFieldValues(
  name STRING)
  RETURNS DYNAMIC ARRAY OF STRING 
Return a list of values from a table, tree, or screen record.
getFocus()
  RETURNS STRING
Return the name of the current focused element.
getFormName()
  RETURNS STRING
Get the current form name.
getFormTitle()
  RETURNS STRING
Get the current form title.
getValue()
   RETURNS STRING 
Return the value in the current field.
getValues()
   RETURNS DYNAMIC ARRAY OF STRING
Returns the values of the current row of the current table, tree, or matrix.
getWidgetType(
  fieldName STRING)
  RETURNS STRING
Return the widget type of the specified field.
getWindowName()
  RETURNS STRING
Get the current window name.
getWindowTitle() RETURNS STRING
Get the current window title.
Table 7. Functions for retrieving messages and errors
Function Description
getError()
  RETURNS ggc.Message
Return the current error message.
getMessage()
  RETURNS ggc.Message
Return the current message.
Table 8. Functions for retrieving action state
Function Description
isActionActive(
  name STRING )
  RETURNS BOOLEAN
Return the state of the specified action.
Table 9. Functions for retrieving information about tables
Function Description
getColumnCount(
   tableName  STRING )
  RETURNS INTEGER 
Get the number of columns in a table.
getColumnName(
   tableName  STRING, 
   idx INTEGER  )
  RETURNS STRING
Get a table column name.
getCurrentColumn(
   tableName  STRING )
  RETURNS INTEGER 
Get the current column in a table.
getCurrentRow(
   tableName  STRING )
  RETURNS INTEGER
Get the current row of the table.
getTableOffset(
  tableName  STRING)
  RETURNS INTEGER
Get the table's current offset value.
getTableSize(
  tableName  STRING)
  RETURNS INTEGER
Get the table size.
Table 10. Functions for retrieving session information
Function Description
getApplicationName() 
  RETURNS STRING
Retrieve the application name.
getChildCount()
  RETURNS INTEGER
Retrieve the number of running child applications.
getSessionId()
  RETURNS STRING
Get the current session identifier.
getState()
  RETURNS STRING
Retrieve the application state.
getStatistics()
  RETURNS Statistics
Retrieve the test session statistics.
notifyCheckFailure( message STRING ) 
Report a check failure.
showStatistics()
  RETURNS Statistics
Show test statistics.
Table 11. Methods for the FrontCallRequest
Method Description
(r FrontCallRequest) getFunctionName()
  RETURNS STRING
Returns the front call name.
(r FrontCallRequest) getModuleName()
  RETURNS STRING
Returns the front call module name.
(r FrontCallRequest) getParameterCount()
  RETURNS INTEGER
Returns the parameter count to the front call.
(r FrontCallRequest) getParameterValue(
  index INTEGER)
  RETURNS STRING
Returns the parameter values to the front call.
(r FrontCallRequest) getReturnCount()
  RETURNS INTEGER
Returns the return values count to the front call.
Table 12. Methods for the FrontCallAnswer
Method Description
(a FrontCallAnswer) functionNotFound()
Initializes a front call answer object with "Function not found" error.
(a FrontCallAnswer) moduleNotFound()
Initializes a front call answer object with "Module not found" error.
(a FrontCallAnswer) notProcessed()
Leave the front call unprocessed.
(a FrontCallAnswer) returnInteger(
  value INTEGER )
Adds an integer return value.
(a FrontCallAnswer) returnString(
  value STRING )
Adds a string return value.
(a FrontCallAnswer) stackError()
Initializes a front call answer object with "Stack error" error.
(a FrontCallAnswer) success()
Initializes a front call answer object with SUCCESS status.
(a FrontCallAnswer) userError(errorMessage STRING)
Initializes a front call answer object with custom error and error message.