妄确是神马?楼主?你这是变相夸自己啊~
我是以前刚开始玩QTP的时候在对象库里发现的这个属性,然后上网查的的内容
关于CreationTime,在帮助文档里详细的说明:
Identifying an Object Using the CreationTime Property
While learning a browser object, QuickTest assigns a value to the CreationTime identification property. This value indicates the order in which the browser was opened relative to other open browsers. The first browser that opens receives the value CreationTime = 0.
During the run session, if QuickTest is unable to identify a browser object based solely on its test object description, it examines the order in which the browsers were opened, and then uses the CreationTime property to identify the correct one.
For example, if QuickTest learns three browsers that are opened at 9:01 pm, 9:03 pm, and 9:05 pm, QuickTest assigns the CreationTime values, as follows: CreationTime = 0 to the 9:01 am browser, CreationTime = 1 to the 9:03 am browser, and CreationTime = 2 to the 9:06 am browser.
At 10:30 pm, when you run a test or component with these browser objects, suppose the browsers are opened at 10:31 pm, 10:33 pm, and 10:34 pm. QuickTest identifies the browsers, as follows: the 10:31 pm browser is identified with the browser test object with CreationTime = 0, 10:33 pm browser is identified with the test object with CreationTime = 1, 10:34 pm browser is identified with the test object with CreationTime = 2.
If there are several open browsers, the one with the lowest CreationTime is the first one that was opened and the one with the highest CreationTime is the last one that was opened. For example, if there are three or more browsers open, the one with CreationTime = 2 is the third browser that was opened. If seven browsers are opened during a recording session, the browser with CreationTime = 6 is the last browser opened.
If a step was created on a Browser object with a specific CreationTime value, but during a run session there is no open browser with that CreationTime value, the step will run on the browser that has the highest CreationTime value. For example, if a step was created on a Browser object with CreationTime = 6, but during the run session there are only two open browsers, with CreationTime = 0 and CreationTime = 1, then the step runs on the last browser opened, which in this example is the browser with CreationTime = 1.作者: xjwldlover 时间: 2012-12-13 10:17
--补充--
可以通过两种方式获取browser的hwnd
Browser("micclass:=Browser","CreationTime:=1").GetROProperty("hwnd")
Browser("micclass:=Browser","CreationTime:=1").Object.HWND
如果是通过vbs进行对象的判断,使用第二个;如果使用qtp进行对象识别(QTP对象操作),则使用第一个。作者: slxmikesong 时间: 2012-12-13 10:43 回复 2#黑羽祭
版主,我的OpenNewTab为什么就不好使呢。。。环境:QTP11.0+Win7+IE8.0作者: 黑羽祭 时间: 2012-12-13 11:08 回复 6#slxmikesong