上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: ' ================================================================================== '' Download Automation Tests from QC'' 1. get all folders, for each folder:' a. check it has attachments or not. if yes, download its attachments to local folders' b. check it has child f 阅读全文
posted @ 2012-09-13 17:35 dushuai 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 这里举例批量将脚本名的"_"替换成"-"'************************************************************************************************************************ 'Description: ' 'Assumptions: ' There is no unsaved test currently open in QuickTest. ' For more information, see 阅读全文
posted @ 2012-09-13 17:26 dushuai 阅读(302) 评论(0) 推荐(0) 编辑
摘要: ' ***************************** Function Library ****************************** RegisterUserFunc "WebTable", "ObjectsByMicClass", "ObjectsByMicClass"' Function: ObjectsByMicClass ' Description: Returns a collection of objects. All the objects in a ' WebT 阅读全文
posted @ 2012-09-13 09:43 dushuai 阅读(76) 评论(0) 推荐(0) 编辑
摘要: '类的继承模式举例:'创建一个继承类库Class ClassHelperprivate dict'添加方法public default function addMethod(name)set dict(name) = getRef(dict("type") & name)end function'创建字典对象private function createDict()set createDict = CreateObject("scripting.dictionary")end function'复制字典对象 阅读全文
posted @ 2012-09-11 15:25 dushuai 阅读(178) 评论(0) 推荐(0) 编辑
摘要: '函数指针模式举例:'函数tt1Function tt1Msgbox "tt1"End Function'函数tt2Function tt2Msgbox "tt2"End Function'建立测试流函数Function TestFlow(LoadFuncs)'遍历所有载入的函数名,并利用函数指针进行调用For i = 0 To UBound(LoadFuncs) - LBound(LoadFuncs)'将CallFunc的指针指向动态载入的函数Set CallFunc = GetRef(LoadFuncs 阅读全文
posted @ 2012-09-11 09:51 dushuai 阅读(131) 评论(0) 推荐(0) 编辑
摘要: '回调设计模式举例:On Error Resume Next'创建一个类Class CallBack'被调用的对象Dim Caller'回调的动态脚本Dim CallBackScript'类的销毁化Sub Class_Terminate()Execute CallBackScriptEnd SubEnd Class'Test函数Function Test()'定义回调变量Dim CB'实例化回调Callback类Set CB = New Callback'加入回调设计代码块CB.CallBackScript = " 阅读全文
posted @ 2012-09-11 09:43 dushuai 阅读(162) 评论(0) 推荐(0) 编辑
摘要: '命令包装模式举例:'定义一个oCommand类Class oCommand'定义输入Private VarIntNumPublic Property Get NumberNumber = VarIntNumEnd PropertyPublic Property Let Number(ByVal oNum)VarIntNum = oNumEnd Property'定义输出Private VarResultPublic Property Get ResultResult = VarResultEnd PropertyPublic Property Let Resu 阅读全文
posted @ 2012-09-11 09:36 dushuai 阅读(145) 评论(0) 推荐(0) 编辑
摘要: '工厂设计模式举例:Public oOutputsSet oOutputs = New OutFactoryClass OutFactoryPublic Channels '定义变量Private Sub Class_InitializeSet Me.Channels = CreateObject("Scripting.Dictionary")End SubPrivate Sub Class_TerminateSet Me.Channels = NothingEnd SubPublic Sub Construct(sChannelName, sChannel 阅读全文
posted @ 2012-09-11 09:24 dushuai 阅读(211) 评论(0) 推荐(0) 编辑
摘要: '单例设计模式举例:Option ExplicitPublic oExcel '声明全局变量Class ExcelWrapperPrivate oExcelObject'初始化类Private Sub Class_InitializeDim bAlreadyInit '判断对象是否存在的标志位'检查对象是否已经被初始化bAlreadyInit = FalseIf IsObject(oExcel) = True then'对象初始化If Not oExcel is Nothin then'激活状态bAlreadyInit = TrueEnd 阅读全文
posted @ 2012-09-07 18:04 dushuai 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Print Setting("executionline") + 1 阅读全文
posted @ 2012-09-07 14:15 dushuai 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页