摘要: 第一种方法:ExecuteFile,利用该函数将外部vbs动态地加载进来,使测试脚本可以调用vbs文件的所有函数,调用语句写在下方,顺序不能颠倒,否则会报错。这个方法适用于QTP任何版本,但有个缺点,代码调试时不能跟踪到外部vbs的函数中,多少有些不便。 ExecuteFile File File 阅读全文
posted @ 2016-07-03 07:34 alice云学习 阅读(1675) 评论(0) 推荐(0) 编辑
摘要: Dim username,passwordDim expectvalue,actualvalueDim currentcount,casecountDim isystemutil.Run"C:\Program Files (x86)\HP\Unified Functional Testing\sam 阅读全文
posted @ 2016-07-03 06:54 alice云学习 阅读(256) 评论(0) 推荐(0) 编辑
摘要: '计算器一位加法计算,并将实际值,测试结果输出,最终导入到本地 Dim iDim inputDim expertvalue,actualvaluedatatable.ImportSheet "C:\Users\Administrator\Desktop\UFT活动讲课资料\加法运算case.xlsx 阅读全文
posted @ 2016-06-26 07:58 alice云学习 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 自动化对象模型AOM的应用(使用AOM的方式运行UFT中的脚本)'定义qtapp对象变量Dim qtapp'创建qtapp对象Set qtapp =CreateObject("quicktest.application")'启动uftqtapp.Launch'设置uft显示类型qtapp.Visib 阅读全文
posted @ 2016-06-16 11:11 alice云学习 阅读(551) 评论(0) 推荐(0) 编辑
摘要: 创建excel文件Sub addexcel(excelpath) '定义excel文件对象 Dim exlapp '定义excel工作簿 Dim exlworkbook '定义excel表格 Dim exlworksheet '创建excel对象 Set exlapp = CreateObject( 阅读全文
posted @ 2016-06-15 17:47 alice云学习 阅读(283) 评论(0) 推荐(0) 编辑
摘要: '根据两个数进行加法和减法运算'1、输入+号,则进行加法运算'2、输入-号,则进行减法运算 Dim opera,operb,result,operMsgBox "+.加法功能"&vbcrlf&"-.减法功能"oper=InputBox("请选择功能")opera=InputBox("输入a数据")o 阅读全文
posted @ 2016-06-15 11:56 alice云学习 阅读(414) 评论(0) 推荐(0) 编辑
摘要: '创建日志文件并在该文件里添加内容 Sub writelog(log) Const forreading =1,forwriting =2,foraddpending=8 Dim fso,f Dim filepath filepath ="C:\log\log.txt" Set fso =creat 阅读全文
posted @ 2016-06-14 22:42 alice云学习 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 调用 createfolder函数createfolder("C:\Users\lcy\Desktop\UFTtest\test")<!--EndFragment-->'在本地创建一个文件夹的封装函数Function createfolder(folderpath) Dim sfo,f Set sf 阅读全文
posted @ 2016-06-14 22:40 alice云学习 阅读(342) 评论(0) 推荐(0) 编辑