51Testing软件测试论坛
标题:
使用QTP中的例子运行为什么也会报错啊
[打印本页]
作者:
jimmyzhou
时间:
2009-6-22 18:51
标题:
使用QTP中的例子运行为什么也会报错啊
查询HELP中的CreateUserDefinedObject函数,会给一个例子,直接拷贝到QTP中运行,也会报错,请问各位大侠是什么原因。
作者:
sc_zk2008
时间:
2009-6-23 10:37
可能是对象库中不存在这个对象吧,因为你是复制的脚本!
作者:
wugecat
时间:
2009-6-23 15:52
QTP的例子也有bug的...这是帮助中的一个方法..就不能执行,方法返回时写错了方法名
Function ItemByKeyColumn(Obj, KeyColumnIndex, KeyColumnValue, KeyItemIndex, TargetColumnIndex, micClass, TargetItemIndex)
Set Table = Obj
rowCount = Table.RowCount
' If TargetItemIndex was not specified, use 1 as default
If TargetItemIndex < 1 Then
TargetItemIndex = 1
End If
' If KeyColumnIndex was not specified, use 1 as default
If KeyItemIndex < 1 Then
KeyItemIndex = 1
End If
' Look for KeyColumnValue in the key column to determine from which
' row to retrieve the target item
Row = 0
foundIndex = 0
While Row <= RowCount And foundIndex < KeyItemIndex
Row = Row + 1
CellData = Table.GetCellData(Row, KeyColumnIndex)
If CellData = KeyColumnValue Then
foundIndex = foundIndex + 1
End If
Wend
If foundIndex < KeyItemIndex Then
Exit Function
End If
' Now that we know the row, retrieve the item (according to its micClass)
' from the target column.
ChildItemsCount = Table.ChildItemCount(Row, TargetColumnIndex, micClass)
If ChildItemsCount >=1 And ChildItemsCount >= TargetItemIndex Then
Set GetItemByKeyColumn = Table.ChildItem(Row, TargetColumnIndex, micClass, TargetItemIndex-1)
End If
End Function
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2