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