QTP对象的一些隐藏的属性和方法
来源:互联网 发布:java判断请求的浏览器 编辑:程序博客网 时间:2024/06/07 01:47
I’ve been doing some digging into QTP’s test-objects, hoping to find some undocumented methods and techniques. Armed with the power of PDM.DLL, I’ve explored each test object, and have come up with these interesting results, all of which don’t show up on your regular intellisense autocomplete.
As this is still a work in process, the function of many methods is still unclear. I’ve set up a color coding system to make things more clear – Red = Don’t have a clue. Black = Have a pretty good idea / an educated guess. Green = Presumably know exactly what the method is supposed to do.
If any of you know the purpose and function of these methods, please fill me in by dropping a comment, and I’ll update the article.
Update: mayno224 has informed us that a Java object MethodWizard method will open a window with all the object’s internal methods (similar to the .Net form’s spy).
All Objects
All QTP test objects have these five methods in common:
1. Highlight – Highlights the object, much like the highlight feature in the object-repository.
2. QueryValue(Property, PropertyData), GetProperty(Property, pFlags, pType, pParameterName) and SetProperty(Property, Value, pFlags, pType, pParameterName)– I haven’t been able to figure out what these method do. If any of you manage to crack this up, I would appreciate it if you dropped a comment.
3. ToString – Returns a string representation of the object. Usually it’s just the name.
4. Init – As described here, re-links the test-object to the runtime object. Especially useful in a web environment, after a page refresh.
Web
All Objects:
Method
Description
.MakeObjVisibleScrolls the object into view (if needed). Similar to the documented .MakeVisible method for ActiveX objectsBrowser:
Method
Description
.AddCookie(Domain, Cookies).GetCookies(Url, Cookies)Probably syntactically sets / gets cookie data..RefreshWebSupportPerhaps the underlying method behind the visible .Refresh method?.SubmitForm(bstrUrl, bstrTargetFrame, bstrPostData, bstrHeaders)Submit forms “hardcore” style.
Page:
Method
Description
.RefreshObjectsProbably performs .Init on all its childobjects..StartTransaction(Name).EndTransaction(Name, Status)
.SetTransactionStatus(Status)Don’t have a clue..SaveLayout(pDoc)
.RestoreLayout(elemTag, elemID, propName, propValue)Presumably saves/restores the visible layout of the page.
All other web objects (WebElement, WebList, WebButton, etc.):
Method
Description
.SubmitPresumably submits a form, if activated on the relevant object.MouseOverSimilar to firing the OnMouseOver event.Standard Windows
All Objects:
Method
Description
ClickOnText(TextToFind, Left, Top, Right, Bottom, MatchWholeWordOnly, BUTTON, DoubleClick)Extremely useful method! A merge between .GetTextLocation and .Click: It finds the specified text within the object, and clicksAll the parameters are self-explanatory. BUTTON is the button code (look under the click method in QTP help); and DoubleClick is boolean.WinEdit:
Method
Description
.SetTextSeems to be exactly like the regular .Set method. However, Neither function uses the other (checked with RegisterUserFunc)WinButton:
Method
Description
.PressSeems to be exactly like the regular .Click method. However, Neither function uses the other (checked with RegisterUserFunc)WinMenu:
Method
Description
.PrepareMenu(phSubMenu, peMenuObjectType)Perhaps has something to do with loading the sub-menu items for a given menu option..Net (SWF objects)
All Objects:
Method
Description
ClickOnText(TextToFind, Left, Top, Right, Bottom, MatchWholeWordOnly, BUTTON, DoubleClick)Same as in Standard Windows.SpyLaunches the .Net form spy for the relevant object. Perfect for objects you cannot get your mouse to point to.CreateManagedObject(bsType, bsFile, pVal)Have no idea.SwfTable:
Method
Description
GetCellCoord(Row, Column, X, Y)Probably the underlying method behind ClickCell. Should return the cell coordinates though the ByRef X,Y variables, but keeps spitting out an error (Perhaps the variables have to be cased into long integers?).SwfButton:
Method
Description
.PressSeems to be exactly like the regular .Click method. However, Neither function uses the other (checked with RegisterUserFuc).Java
All Objects:
Method
Description
InvokeMethod(MethodName, MethodArguments)My guess is it calls an inner method of the object.MethodWizard()Thanks to Mayno224: Will present a screen with all the object’s internal methods. Kinda similar to .Net objects Spy.RequestFocus()Presumably brings the object into focus.ClickOnText(TextToFind, Left, Top, Right, Bottom, MatchWholeWordOnly, BUTTON, DoubleClick)Same as in Standard Windows.Other environments and updates will be published when I’ve completed my investigation, and when reads will drop in more information through comments.
- QTP对象的一些隐藏的属性和方法
- QTP获取浏览器的一些常用属性的方法
- QTP和excel的一些备用方法 和其他
- DHTNL中window对象一些常用的属性和方法
- js面向对象的一些属性和方法
- [基础] -- [request] -- Request对象的一些属性和方法
- JavaScript新创建对象的一些属性和方法
- QTP运行对象属性和对象库属性的区别和用法
- 如何查看QTP对象的属性列表
- QTP使用中的一些好的方法
- 一些QTP比较实用的方法
- QTP对象识别不了的方法
- 关于(qtp)Reporter对象的ReportEvent方法
- QTP对象的方法(一)
- jquery对象和DOM对象调用一些方法及属性的区别(收集中)
- QTP中的对象和方法
- 类和对象的属性和方法
- QTP识别和操作对象的原理
- ajax实例1
- Ubuntu 下 java 版本的切换
- 4.Struts的<action input=""></action>:业务逻辑层
- chap_12.3新学习
- C++ AMP掠影
- QTP对象的一些隐藏的属性和方法
- 5.Struts的<action input=""></action>:struts-config.xml
- 6.Struts的<action input=""></action>:web.xml
- 从0开始学习PHP,学到建立网站,001 基本语法
- 关于undefined的含义
- Oracle的SQL语句大全(摘)--- 复杂
- weblogic 配置操作
- apache2 Time Out时间修改
- 爱你的传奇