'几个重要的方法:OpenTextFile,AtEndofLine,Split
Dim Fileobj,FilePath,FileName,Arrayline
FilePath="E:\cntesting.txt" '操作文本的所在路径也可以为表达式
'创建一个文本文件并写入数据 <U廕
7G"
Set objth = CreateObject ("Scripting.FileSystemObject") 嘀愤l椕
Set AdFile = objth.OpenTextFile(FilePath,2,true) '此方法打开指定的文件并返回TextStream对象 ,第一个参数为要打开文件字符串表达式,第二个参数有三个值1,2,8可选,第三个参数True为创建新文件 I姠O城蕇
AdF..
2007-10-18 14:32
2007-10-18 13:18
'重要方法 ImportSheet后面的参数说明:文件路径,global名字,global %A
Function WriteExcel() 靳C殷帓
Dim ExcelContent(3) 谗(6Lw :
strFileName = "E:\cntesting.xls" 'Excel文件路径 K擎E鐉M袀
For j = 0 to 3 桫鼜崚
ExcelContent(j) = "" 鍎u楻銟Q
Next ExcelContent(1) = DataTable("I_orderId", dtGlobalSheet) 駫誦棶Q
ExcelContent(2) = DataTable("I_orderAmountEqual", dtGlobalSheet) 輹 >?w
' 写数据到Excel文件 鍛鉭鰈唠
Dim Obj, Look, Sheet !s.?*靴
Set Obj = CreateObject("Excel..
Function WriteExcel() 靳C殷帓
Dim ExcelContent(3) 谗(6Lw :
strFileName = "E:\cntesting.xls" 'Excel文件路径 K擎E鐉M袀
For j = 0 to 3 桫鼜崚
ExcelContent(j) = "" 鍎u楻銟Q
Next ExcelContent(1) = DataTable("I_orderId", dtGlobalSheet) 駫誦棶Q
ExcelContent(2) = DataTable("I_orderAmountEqual", dtGlobalSheet) 輹 >?w
' 写数据到Excel文件 鍛鉭鰈唠
Dim Obj, Look, Sheet !s.?*靴
Set Obj = CreateObject("Excel..
2007-10-18 12:39
下面是本人在项目实战中遇到的一些问题的解决方案:
---------------------------------------------------------------------------
问->“实际项目录制脚本时经常遇到这种情况,伴随着系统不断的版本升级更新,需要我们在许多不同情况下回放同样的脚本,这样带来大量脚本中IE跳转地址的变动,有更好的方法能更快速,准确的实现这个需求吗?”
答->有的,一般情况下最好的方式是把IE跳转地址,在脚本中实现而不是在Record and run settings 中设置打开固定的IE请求地址。如下:InvokeApplication "C:\Program Files..
2007-10-18 12:33
QTP错误恢复机制-场景恢复功能:
1024) this.width=1024;" border=0>
步骤一:选择工具拦Resources->Recovery scenario Manager
1024) this.width=1024;" border=0>
步骤二:进入场景恢复界面,点下一步继续。
1024) this.width=1024;" border=0>
步骤三:选择Test run error 运行时错误项(当运行错误时实现场景恢复)。
1024) this.width=1024;" border=0>
步骤四:选择错误类型(这里选择任何错误发生的情况下)。检验不同类型错误发生应该选择不同的项。
1024) this.width=1024;" border=0>
步骤五:错误操..
2007-10-18 12:27
嵌套Action之间的参数传递:
1024) this.width=1024;" border=0>
步骤一:建立2个互相嵌套的Action(Action_Two在Action_one的里面),在Action_one中点击右键选择Action properties。
1024) this.width=1024;" border=0>
步骤二:选择parameters单元格,在input parameters 和 output parameters中添加参数名。
1024) this.width=1024;" border=0>
步骤三:右键Action_Two 选择Action properties。
1024) this.width=1024;" border=0>
步骤四:在input parameters 和 output parameters 输入参数名。
1024) this.wid..
2007-10-18 11:28
并列Action之间的参数传递:(目的:将并列Action_one中的参数传递给 Action_Two)
1024) this.width=1024;" border=0>
步骤一:首先建立2个并列Action(并列Action_one,并列Action_Two),然后如图右击并列Action_one->选择Action properties.
1024) this.width=1024;" border=0>
步骤二:选择Parameters单元,在output parameters 的name 一列填写参数名。
1024) this.width=1024;" border=0>
步骤三:右击并列Action_Two->Action Properties,设置Action_Two参数值。
1024) this.width=1024;" border=0>
步骤四..
2007-10-18 11:22
QTP创建Oracle数据库检查点步骤:
1024) this.width=1024;" border=0>
步骤一:点击工具拦的insert->Checkpoint->Database Checkpoint
1024) this.width=1024;" border=0>
步骤二:按默认选项不更改,点击 Next >
1024) this.width=1024;" border=0>
步骤三:一些说明,不管它直接点ok。
1024) this.width=1024;" border=0>
步骤四:选择左侧新数据源点确定新建一个数据源。
1024) this.width=1024;" border=0>
步骤五:填写新数据源名称,为便记忆,本例数据源写了Ora。
1024) this.width=1024;" bo..
2007-10-18 10:20
面向对象的思想概述:
下面是本人对Java编程的一点小经验之后的理解:面向对象其实是现实世界模型的自然延伸。现实世界中任何实体都可以看作是对象。对象之间通过消息相互作用。另外,现实世界中任何实体都可归属于某类事物,任何对象都是某一类事物的实例。如果说传统的面向过程式编程语言是以过程为中心以算法为驱动的话,面向对象的编程语言则是以对象为中心以消息为驱动。用公式表示,过程式编程语言为:程序=算法+数据;面向对象编程语言为:程序=对象+消息。
为便于大家去理解,从各个角度去理会,下面我举个..
