QTP中,如何获取datatable中特定行,特定列的值?
如:我需要拿DataTable("A",dtlocalsheet)列中所有的参数,去跟DataTable("B",dtlocalsheet)中第二行的参数进行比较,假如DataTable("B",dtlocalsheet)在第10列,请大侠们指教啊,急急急~~! 我写了一个例子给你参考Dim i,dtlocalsheet,B
dtlocalsheet="Action1"
DataTable.GetSheet(dtlocalsheet).SetCurrentRow 2
B=DataTable("B",dtlocalsheet)
For i=1 to DataTable.GetSheet(dtlocalsheet).GetRowCount
DataTable.GetSheet(dtlocalsheet).SetCurrentRow i
If DataTable("A",dtlocalsheet)=B Then
Reporter.ReportEvent micPass,"正确","OK"
Else
Reporter.ReportEvent micFail,"错误","NG"
End If
Next
回复 2# mimmy
明白了,谢谢兄弟。
页:
[1]