在RFT中如何獲取JTable中的所有資料?
在RFT中如何獲取JTable中的所有資料?
public void testMain(Object[] args)
{
//Start Classics Java Application
startApp ( "ClassicsJavaA" );
//Navigate to Existing Order Grid
jmb().click(atPath ( "Order" ));
jmb().click(atPath ( "Order->View Existing Order Status..." ));
// Frame: View Order Status
nameComboB().click();
nameComboB().click(atText ( "Claire Stratus" ));
ok().click();
// Frame: View Existing Orders
existingTable().click(atPoint (172,92));
//Get the data for the table
ITestDataTable orderTable = (ITestDataTable)existingTable().getTestData( "contents" );
//Display the available data types for the grid, total rows and columns.
System. out .println ( "Available Data Types: " + existingTable().getTestDataTypes ());
System. out .println ( "Total Rows in table : " + orderTable.getRowCount());
System. out .println ( "Total Cols in table : " + orderTable.getColumnCount());
// Cycle through all rows
for ( int row=0; row < orderTable.getRowCount();++row)
{
// Cycle through all columns
for ( int col=0; col < orderTable.getColumnCount();++col)
{
// Print out values of cells at (row,col ) coordinates
System. out .println ( "Row " + row + ", " + orderTable.getColumnHeader (col) + ": " +orderTable.getCell (row,col) );
}
}
// Close the frame
close().click();
// Frame: ClassicsCD
classicsJava( ANY , MAY_EXIT ).close();
}
}
控制檯輸出:
Available Data Types: {contents=表內容, visible contents=可見表內容, selected=選中的表單元格, visible selected=選定可見表單元格}
Total Rows in table : 1
Total Cols in table : 7
Row 0, ORDER ID: 7
Row 0, ORDER DATE: 3/11/98
Row 0, STATUS: Order Initiated
Row 0, COMPOSER: Bach
Row 0, COMPOSITION: Brandenburg Concertos Nos. 1 & 3
Row 0, QUANTITY: 5
Row 0, TOTAL: 84.9500
相關文章
- 在MySQL中,如何獲取資料庫下所有表的資料行數?MySql資料庫
- 在ActionForm中如何獲取session中的資料?ORMSession
- 在RFT中如何通過指令碼獲取已新增到某個指令碼中的測試物件?指令碼物件
- 在RFT中如何擷取螢幕影像並儲存到檔案中?
- Flutter 中的資料的獲取Flutter
- SQL Server中獲取一個資料庫的所有表的列數SQLServer資料庫
- 【譯】如何在React Hooks中獲取資料?ReactHook
- Android逆向之旅---Android中如何獲取在非Root裝置中獲取應用隱私資料Android
- 獲取SQL資料庫中某個表中的所有欄位名稱的通用方法SQL資料庫
- 在RFT中關閉所有IE瀏覽器視窗的3種方法瀏覽器
- android如何獲取listview中的任意行資料AndroidView
- API介面在電商商品資料獲取中的應用API
- 從session中獲取資料Session
- JTable 在TCP傳輸中報錯TCP
- 怎樣在程式中獲取所有執行緒的堆疊資訊?執行緒
- js如何獲取元素在頁面中的位置JS
- 說說在 Python 中,如何讀取檔案中的資料Python
- Thymeleaf+SpringMVC,如何從模板中獲取資料SpringMVC
- 在Linux中,如何獲取CPU的總核心數?Linux
- checkBox核取方塊,獲得選中那一行所有列的資料
- Nuxt中如何使用Vuex-Store非同步獲取資料UXVue非同步
- 從 falcon api 中獲取資料API
- 從資料字典中獲取ash資訊
- javascript如何獲取指定元素在陣列中的數目JavaScript陣列
- 在PHP中如何獲取使用者的真實IPPHP
- jQuery如何獲取iframe中的元素jQuery
- .在java和java web程式中的含義以及如何獲取web資源JavaWeb
- python如何幫我在投資中獲取更高收益Python
- js如何獲取指定元素在陣列中個數JS陣列
- 在Excel中如何獲取漢字拼音首字母?Excel
- Java 獲取Word中的所有插入和刪除修訂Java
- 獲取資料夾及其子資料夾下的所有檔案
- QTP中如何快速獲取Page中的物件個數QT物件
- jquery獲取所有選中的checkbox與單個選中的radiojQuery
- Oracle獲取資料庫中的物件建立語句Oracle資料庫物件
- Android ListView中獲取選中行資料的方法AndroidView
- 獲取某個資料所在資料列表中的行數 mysqlMySql
- 如何在 Janus 中獲取 WebRTC 的流Web