上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: '1.WebEdit:'HTML源代码样例:'<INPUT type="text" value="QuickTest" id="ID_001" name="NAME_001">'QTP中代码样例:'操作方式1:'获取DOM对象set oDocument = Browser("Browser").Page("Page").Object'使用GetElementByID获取对象元素,并更改文本框WebEdit的v 阅读全文
posted @ 2012-09-07 14:02 dushuai 阅读(287) 评论(0) 推荐(0) 编辑
摘要: '等待页面加载:'使用IE COM启动IESet oIE = CreateObject("InternetExplorer.Application")oIE.Visible = True '设置可见oIE.Navigate "http://www.baidu.com" '跳转URL'等待IE页面加载完毕While oIE.Busy: Wend'利用DOM操作测试对象'(1)通过getElementByID方法获取定位对象,并对其进行操作:'使用IE COM启动IEoIE.Visible = 阅读全文
posted @ 2012-09-07 10:36 dushuai 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 'Action1:'Give the print data proxySet fnGPrintData = GetRef("PrintData")Call GlobalFuncFunction PrintData(a,b)'Print data in some formatEnd Function'Global Library:Dim fnGPrintDataFunction GlobalFunc()Call fnGPrintData(4,5)End Function 阅读全文
posted @ 2012-09-06 15:34 dushuai 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 'Simulate typingSetting.WebPackage("ReplayType") = 2'Type some text into the search textboxBrowser("Google").Page("Google").WebEdit("q").Set "Tarun Lalwani"'Wait for 500 msecWait 0,500Dim oList'Get the suggestion list tableSet oList = 阅读全文
posted @ 2012-09-06 15:29 dushuai 阅读(151) 评论(0) 推荐(0) 编辑
摘要: '重写MsgboxFunction NewMsgbox(text)Print "Msgbox - " & textEnd FunctionDim ptrMsgBox, MsgBox'Get the reference to new functionSet ptrMsgBox = GetRef("NewMsgbox")'Override the message box nowSet MsgBox = ptrMsgBox'Now in every Action we just need to add two lines 阅读全文
posted @ 2012-09-06 14:01 dushuai 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Function GetTestObjectName(obj)GetTestObjectName = ""If IsNull(Obj) or IsEmpty(obj) Then Exit FunctionDim strObjectNamestrObjectName = obj.ToStringstrObjectName = Split(strObjectName, "")(1) & "(""" & Split(strObjectName, "")(0) & "& 阅读全文
posted @ 2012-09-06 09:01 dushuai 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 非Tab模式:Hwnd = Browser("X").object.HWNDWindow("hwnd:=" & hwnd).MaximizeTab模式:Dim hwndBrw, hwndWindowhwndBrw = Browser("Browser").GetROProperty("hwnd")Const GA_ROOT = 2'Declare Function GetAncestor Lib "user32.dll" (ByVal hwnd As Long, ByVal ga 阅读全文
posted @ 2012-09-06 08:54 dushuai 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Window("Test").VirtualButton("x:=10", "y:=10", "width:=10", "height:=10").Click 阅读全文
posted @ 2012-09-02 21:44 dushuai 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 部分可以, 需要注意以下几点:1.QTP may not be able to identify objects. Though it would still be able to identify all web objects.2.Any screenshots capture using CaptureBitmap will give a black screen.3.QTP will fail on performing actions on non-web object.4.It will also fail on web objects if the ReplayType sett 阅读全文
posted @ 2012-09-02 21:41 dushuai 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 修改如下注册表:HKEY_LOCAL_MATHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\Logger\Media\Log将Active从0改到1 阅读全文
posted @ 2012-09-02 21:19 dushuai 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页