Centura Gupta Team Developer Automation Possibility

混江龙づ霸主 提交于 2019-12-11 06:57:21

问题


Is there a automation tool which can automate the software build on Team Developer (v6.0).

I have tried with multiple automation tools to spy the table object in the application, it identifies it as Gupta ChildTable. But I am not able to retrieve the values from the row.

For example: 1. I have 10 rows in the table(grid) with 12 columns. I need to find the value "AAAAA" contained in first column and select that particular row via Automation. 2. I have 10 rows in the table(grid) with 12 columns. I need to find the value "AAAAA" contained in first column and click on particular cell in that row to input the data via Automation.

Thanks in advance.


回答1:


Use VisTblFindString . This function ( and many others ) are included into your TD code if include 'VT.apl' in your include libraries . VisTblFindString will return the Row - so then you simply set context to that row using SalTblSetContext( hWndForm, nRow ) , and then you can refer to the contents of each cell by name to return the value.

Syntax

nRow = VisTblFindString(hWndTable, nStartRow, hWndColumn, sString)

Handle: hWndTable

Number: nStartRow

Number: hWndColumn

String: sString

Description

Locates a string value within a column.

The string must match exactly, but case is ignored. Searching ends when the last row in the table is checked. A SAM_FetchRow message is sent for all rows that have not yet been fetched into the cache.

You can use the pattern matching characters understood by the function SalStrScan. The percent character (%) matches any set of characters. The underscore character ( _ ) matches any single character.

Parameters

hWndTable Table window handle.

nStartRow Row number at which to start the search.

hWndColumn Handle of column to search. Use hWndNULL to search all string columns.

sString String for which to search.

Return Value

Number: The row number if sString is found, or -1 if not found.

Example: Set nRow = VisTblFindString (twOrders, 0, colDesc, 'AAAAAA') Call SalTblSetContext( twOrders , nRow ) ( Now you can get the value of any cell in nRow by referring to the Column Name ) e.g. Set sCellValue = twOrders.colDesc or Set sCellValue = twOrders.colId etc.




回答2:


Rows ( or anything what-so-ever in a TableWindow - even the cell borders , backgrounds , lines, row headers etc ) can be treat as an 'Item' or 'Object' by TeamDeveloper . Recommend you use MTbl - it is an invaluable set of add-on functions that make dealing with Tables a breeze. I know of no sites using TableWindows that don't use MTbl. In terms of rows , you can define any row as an Item or Object and manipulate it accordingly. See M!Tbl ( a TableWindows extention ) and specifically fcMTblItem.DefineAsRow( hWndTbl, nRow ).

BTW , you can also use MTbl to completely change the look and feel of your TableWindows , to give them a real modern look.




回答3:


Very rough napkin code, don't have TD on this computer. Not that you can copy&paste this easily anyway due to the code structure, only line by line.

tbl1 is the name of the table, col1 is the name of the column, substitute to fit your program.

Set nRow = TBL_MinRow
While SalTblFindNextRow( tbl1, nRow, 0, 0 )
   Call SalTblSetContext( tbl1, nRow )
   If tbl1.col1 = "AAAAA"
      Call SalTblSetFocusCell( tbl1, nRow, tbl1.col1, 0, -1 )
      Break

This should run through each row, check whether col1 has the chosen value, and then activates edit mode for that cell - provided the column is editable.



来源:https://stackoverflow.com/questions/22863114/centura-gupta-team-developer-automation-possibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!