文章分类 -  QTP技巧-对象相关

摘要:Set Obj = ORUtil.GetObject("Browser(""Browser"")")'Update one of the propertiesObj.SetTOProperty "title", "this is set using API"'Update the object we have changedORUtil.Update obj'Save the object repository changesORUtil.SaveSet Obj = No 阅读全文
posted @ 2013-11-22 09:01 dushuai 阅读(119) 评论(0) 推荐(0)
摘要:Dim ORUtil'Create the object repository automation APISet ORUtil = CreateObject("Mercury.ObjectRepositoryUtil")'Load the object repositoryORUtil.Load "C:\temp\SharedOR.tsr"'Get all the objects with class as WebTableSet allTableObjects = ORUtil.GetAllObjectsByClass(&qu 阅读全文
posted @ 2013-11-22 08:57 dushuai 阅读(130) 评论(0) 推荐(0)
摘要:Dim RepositorySet Repository = CreateObject("Mercury.ObjectRepositoryUtil.1")Repository.Load "C:\Test.tsr"'Set Repository = XMLUtil.CreateXMLFromFile("C:\Temp\TestOR.xml")'This array will be used to store all the object definitionsDim outArrayRedim outArray(0)&# 阅读全文
posted @ 2013-06-14 16:37 dushuai 阅读(177) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2012-09-26 16:35 dushuai 阅读(59) 评论(0) 推荐(0)
摘要:Index - Indicates the order in which the object appears in the application coderelative to other objects. Location - Indicates the order in which the object appears on the screen. Values areassigned from top to bottom, and then left to right. CreationTime - Indicates the order in which the Brows... 阅读全文
posted @ 2012-09-26 16:32 dushuai 阅读(191) 评论(0) 推荐(0)
摘要:The SIEBEL add-in uses SIEBEL Automation API, so if a SIEBEL application islaunched before QTP, QTP will still be able to identify the Siebel objects. This isbecause even though Siebel runs inside a web Browser, QTP will not identify theBrowser properly but rather identify it as a normal native wind 阅读全文
posted @ 2012-09-26 09:56 dushuai 阅读(193) 评论(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 阅读(88) 评论(0) 推荐(0)
摘要:Function GetObjectClass(ByVal LogicalName)GetObjectClass = ""Dim arrTypesarrTypes = Array("Browser", "Window", "Dialog", "JavaWindow")On Error Resume NextFor each sType in arrTypesErr.ClearSet TempObj = Eval(sType & "(" & LogicalNam 阅读全文
posted @ 2012-07-09 14:35 dushuai 阅读(241) 评论(0) 推荐(0)
摘要:1. QTP store OR in binary format which makes it impossible for others to create tools that can help make OR creation easier2. Shared OR can be shared across Tests. But it can't be edited by multiple users at the same time. Shared OR are not like shared excel files where multiple users can update 阅读全文
posted @ 2012-07-09 14:16 dushuai 阅读(157) 评论(0) 推荐(0)
摘要:Page("title:=.*Google.*").Exist(0)Page("title:=.*Google.*").WebEdit("name:=q").Exist(0)在QTP版本大于9.5时,以上不会报错 阅读全文
posted @ 2012-07-06 08:00 dushuai 阅读(84) 评论(0) 推荐(0)
摘要:1. 在测试环境, 请开发把image换成固定image2. 在测试环境, 请开发加个tag到Captcha text3. 请开发给出将image解码为text的算法 阅读全文
posted @ 2012-07-05 22:05 dushuai 阅读(173) 评论(0) 推荐(0)
摘要:1. 修改注册表:路径: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BrowseNewProcess2.修改QTP设置:路径: Tools->Options->Web->Advanced->Enable Web Support for Microsoft Windows Explorer 阅读全文
posted @ 2012-07-01 11:14 dushuai 阅读(112) 评论(0) 推荐(0)