0
我對QTP/UFT比較新。我正在編寫測試,需要在同一測試中使用Global和本地數據表中的數據。QTP/UFT - 訪問循環中的多個數據表
我for
循環是這樣的:
Datatable.GetSheet("Global")
RowCount = Datatable.GetRowCount
For Cntr = 1 to RowCount
Datatable.SetCurrentRow(Cntr)
msgbox Datatable("Form", dtGlobalSheet) 'Form is my column Name from Global Data Sheet'
Datatable.GetSheet("Action1")
RowCount2 = Datatable.GetRowCount
For Cntr2 = 1 to RowCount2
Datatable.SetCurrentRow(Cntr2)
msgbox Datatable("Number", dtGlobalSheet) 'Number is my column Name from Action1 Data Sheet'
Next
Next
我的列值都可以從兩個片搞砸了。
感謝Victor的快速回復..這隻適用於一個更改..我使用UFT 12.54,它不支持dtGlobal.Value(「Form」)。所以我用dtGlobal.GetParameter(「Form」)代替它 – phpfreak
我很高興它解決了。不幸的是我沒有UFT了,所以我從[tutorialspoint](https://www.tutorialspoint.com/qtp/qtp_data_table_methods.htm)檢查了方法,因爲我不記得它,並且無法事先測試它。我建議您將此網站加入書籤以備將來參考;) –
當然,我確實。謝謝! – phpfreak