flying32 2008-4-22 18:11
请教TestObject,ProcessTestObject,RootTestObject的区别
rft 帮助文档是这么定义的
public class [b]TestObject [/b]extends java.lang.Object
Provides access to objects in the software under test. A [font=NSimsun]TestObject[/font] contains a reference to an object in the software under test, either referencing the object directly, or by using a reference to a [font=NSimsun]MappedTestObject[/font]. The recognition algorithm is the work of the [font=NSimsun]ObjectManager[/font].
public class [b]ProcessTestObject [/b]extends [url=http://127.0.0.1:60699/help/topic/com.rational.test.ft.api.help/ApiReference/com/rational/test/ft/object/interfaces/TestObject.html][color=#810081]TestObject[/color][/url]
[color=#810081][/color]Provides, in a host-independent manner, access to process information that is specific to the operating system.
public class [b]RootTestObject [/b]extends [url=http://127.0.0.1:60699/help/topic/com.rational.test.ft.api.help/ApiReference/com/rational/test/ft/object/interfaces/TestObject.html][color=#810081]TestObject[/color][/url]
The [font=NSimsun]RootTestObject[/font] represents a global view of the system being tested. It does not represent an actual [font=NSimsun]TestObject[/font] in the software under test, but rather it provides access to system-wide functionality, such as finding an arbitrary [font=NSimsun]TestObject[/font] based on properties, location, or getting the [font=NSimsun]DomainTestObject[/font].
请教大家,这三个有什么区别,特别是[b]RootTestObject 和ProcessTestObject 的区别,他们的作用是什么~![/b]
[[i] 本帖最后由 flying32 于 2008-4-22 18:12 编辑 [/i]]
flying32 2008-4-23 17:52
查看了一些资料,rft中所有的×××TestObject都继承TestObject。
RootTestObject在测试过程中相当于全局的TestObject,可以用RootTestObject中的一些方法来查找我们需要的TestObject。
ProcessTestObject 当使用startApp()方法时就会返回一个ProcessTestObject 。
例子:
ProcessTestObject ftProcess= startApp("Notepad");
RootTestObject root= RootTestObject.getRootTestObject();
Integer pid = new Integer((int)ftProcess.getProcessId());
TestObject[] ftWinO = root.find(atChild(".processId", pid));
[[i] 本帖最后由 flying32 于 2008-4-23 17:53 编辑 [/i]]