QTP学习分享
2007-06-20 11:37
239 查看
发布时间: 2007-5-16 13:50 作者: 风过无息 来源: 51testing软件测试论坛
1.在测试中我们使用QTP调试脚本的时候一般就是DEBUG或者MSGBOX察看一些信息,其实有时候也可以使用print来实现批量的察看信息但是不影响程序运行.
运行脚本:
a="100"
print a
~~~~~~~~~~~~~~~~~~~~~~~~~
2.取datatable特定行的数据可以这样使用
运行脚本:
DataTable.GetSheet("Action1").GetParameter("test").ValueByRow(4)
~~~~~~~~~~~~~~~~~~
3.Wait Seconds [, Milliseconds]可以精确到毫秒.
~~~~~~~~~~~~~~~~~~
4.在自定义的function里面数组作为返回值.
运行脚本:
circuit = "399937"
Function trimString(circuit)
Dim holdArray(5)
holdArray(0) = Left(circuit, 2)
holdArray(1) = Right(circuit, 2)
msgbox holdArray(0) 'showed 39
trimString = holdArray' I get an out of range error here
End Function
dim myArray
'here I want to assign the return array to another array
myArray = trimString(circuit)
' and then call one element from it
msgbox myArray(1)
~~~~~~~~~~~~~~~
5.计算一个操作的时间.
运行脚本:
Browser("Browser").Page("Page").Image("getRates").Click
var_StartTime = Timer
Browser("Browser").Page("Page").Sync
Browser("Browser").Page("Page").Check CheckPoint("Check1")
var_EndTime = Timer
intRespTime = round ((var_EndTime - var_StartTime), 2 )
msgbox (intRespTime)
~~~~~~~~~~~~~~~
6.取得指定sheet(datatable)的行数和列数(也可以理解为参数个数)
paramcount = DataTable.GetSheet("Action1").GetParameterCount
msgbox "There are " ¶mcount&"columns in the data sheet."
rowcount = DataTable.GetSheet("Action1").GetRowCount
msgbox "There are " &rowcount&"rows in the data sheet."
此文来源于51testing论坛,转载请注明出处为51testing论坛
出处http://bbs.51testing.com/viewthread.php?tid=75276
1.在测试中我们使用QTP调试脚本的时候一般就是DEBUG或者MSGBOX察看一些信息,其实有时候也可以使用print来实现批量的察看信息但是不影响程序运行.
运行脚本:
a="100"
print a
~~~~~~~~~~~~~~~~~~~~~~~~~
2.取datatable特定行的数据可以这样使用
运行脚本:
DataTable.GetSheet("Action1").GetParameter("test").ValueByRow(4)
~~~~~~~~~~~~~~~~~~
3.Wait Seconds [, Milliseconds]可以精确到毫秒.
~~~~~~~~~~~~~~~~~~
4.在自定义的function里面数组作为返回值.
运行脚本:
circuit = "399937"
Function trimString(circuit)
Dim holdArray(5)
holdArray(0) = Left(circuit, 2)
holdArray(1) = Right(circuit, 2)
msgbox holdArray(0) 'showed 39
trimString = holdArray' I get an out of range error here
End Function
dim myArray
'here I want to assign the return array to another array
myArray = trimString(circuit)
' and then call one element from it
msgbox myArray(1)
~~~~~~~~~~~~~~~
5.计算一个操作的时间.
运行脚本:
Browser("Browser").Page("Page").Image("getRates").Click
var_StartTime = Timer
Browser("Browser").Page("Page").Sync
Browser("Browser").Page("Page").Check CheckPoint("Check1")
var_EndTime = Timer
intRespTime = round ((var_EndTime - var_StartTime), 2 )
msgbox (intRespTime)
~~~~~~~~~~~~~~~
6.取得指定sheet(datatable)的行数和列数(也可以理解为参数个数)
paramcount = DataTable.GetSheet("Action1").GetParameterCount
msgbox "There are " ¶mcount&"columns in the data sheet."
rowcount = DataTable.GetSheet("Action1").GetRowCount
msgbox "There are " &rowcount&"rows in the data sheet."
此文来源于51testing论坛,转载请注明出处为51testing论坛
出处http://bbs.51testing.com/viewthread.php?tid=75276
相关文章推荐
- QTP学习分享
- 分享Silverlight/WPF/Windows Phone一周学习导读(07月18日-07月24日)
- 学习嵌入式的感想(来自分享)
- ios开发学习-页面控制样式翻页、文字、颜色等效果源码分享
- 分享个学习 Git 的链接
- ROS机器人程序设计(原书第2版)学习镜像分享及使用说明
- 我们要做到不但会写SQL,还要做到写出性能优良的SQL,以下为笔者学习、摘录、并汇总部分资料与大家分享!
- 优雅编程之Trove集合工具类的7点整理学习分享(四十)
- 【转】C语言、vc++、PHP、数据库(SQL)、Java学习视频地址分享
- 分享Linux系统如何学习的一些想法
- 分享Silverlight/WPF/Windows Phone一周学习导读(10月22日-10月29日)
- Python学习班微分享实录:用Python实现Mosaic Photo
- 学习数据库的一点经验与大家分享
- 真实分享记录我学习Linux系统遇到的问题
- 分享Linux系统如何学习的一些想法
- 心得分享: 学习UEFI 之你把C语言学好了码?
- 一个学渣发现的开发学习分享资料
- ios开发学习--动画(Animation)效果源码分享--系列教程1
- < welcome > 一起学习,进步,分享。
- Android学习之Android 5.0分享动画实现微信点击全屏效果