打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
QTP下Datatable Methods
Datatable Methods are used for performing the operations on the runtime datatable.
 
 

AddSheet:-It is used for adding a new sheet to runtime datatable.

Syntax:-DataTable.AddSheet("Sheetname")

Example:-DataTable.AddSheet("laxmi")

DeleteSheet:-It is used for deleting a specified sheet from runtime datatable.

Syntax:-DataTable.DeleteSheet("Sheetname")

Example:-DataTable.DeleteSheet("laxmi")

Import:-It is used for importing all the sheets from Excel sheet to runtime datatable.

Syntax:-DataTable.Import"Path of Excel sheet"

Example:-DataTable.Import"d:\excel1.xls"

ImportSheet:-It is used for importing a specified sheet from Excel sheet to runtime datatable.

Syntax:-DataTable.ImportSheet"Path of Excel Sheet",Source sheetid,Destination sheetid

Example:-DataTable.ImportSheet"d:\excel2.xls",1,1

Here Source and Destination Sheet ids are 1(in this example)

1 is for Global Sheet.

Export:-It is used for exporting a complete runtime datatable(all sheets) to a specified location(path).

Syntax:-DataTable.Export"Path where excel sheet has to be created"

Example:-DataTable.Export"d:\excel3.xls"

 

ExportSheet:-It is used for exporting a specified sheet from a runtime datatable to specified location.

Syntax:-DataTable.ExportSheet"Path of Excel Sheet",Sheet id which has to be exported.

Example:-DataTable.ExportSheet"d:\excel4.xls",1

SetCurrentRow:-This method is used for setting the focus of QTP to a specified row.

Syntax:-DataTable.SetCurrentRow(RowNumber)

Example:-DataTable.SetCurrentRow(1)

SetPrevRow:-This method is used for setting the focus of QTP to the previous row of the currently focused row.

Syntax:-DataTable.SetPrevRow

Example:-DataTable.SetPrevRow

Check my other hub on qtp scripts

SetNextRow:-This method is used for setting the focus of QTP to the next row of the currently focused row.

Syntax:-DataTable.SetNextRow

Example:-DataTable.SetNextRow

GetSheet:-This method is used for making QTP to focus on a specified sheet.

Syntax:-DataTable.GetSheet(SheetId)

Example:-DataTable.GetSheet(1)

GetSheetCount:-This method is used to get count(number) of sheets in datatable.

Syntax:-DataTable.GetSheetCount

Example:-DataTable.GetSheetCount

GetRowCount:-This method is used for getting row count of a sheet.

Syntax:-DataTable.GetRowCount

Example:-DataTable.GetRowCount

By default it will get row count of Globalsheet.

If u want to get row count of a specified sheet then we have to use GetSheet method.

Syntax:-DataTable.GetSheet(SheetId).GetRowCount

Example:-DataTable.GetSheet(2).GetRowCount

 

Value:-It is used for capturing a value from a specified column,specified sheet and currently focused row.

Syntax:-DataTable.Value("column name"/column id,SheetId)

Example:-DataTable.Value("A",2) or DataTable.Value(1,2)

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
QTP学习笔记_不断更新
QTP相关的25个小技巧,软工与管理,C,软件编程
QTP基础代码
QTP中DataTable操作大全 - twf - 51Testing软件测试网 - Po...
QTP 操作EXCEL
如何用java导入Excel数据到数据库?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服