flying32 发表于 2008-4-22 18:11:05

请教TestObject,ProcessTestObject,RootTestObject的区别

rft 帮助文档是这么定义的
public class TestObject extends java.lang.Object
Provides access to objects in the software under test. A TestObject contains a reference to an object in the software under test, either referencing the object directly, or by using a reference to a MappedTestObject. The recognition algorithm is the work of the ObjectManager.

public class ProcessTestObject extends TestObject
Provides, in a host-independent manner, access to process information that is specific to the operating system.

public class RootTestObject extends TestObject
The RootTestObject represents a global view of the system being tested. It does not represent an actual TestObject in the software under test, but rather it provides access to system-wide functionality, such as finding an arbitrary TestObject based on properties, location, or getting the DomainTestObject.

请教大家,这三个有什么区别,特别是RootTestObject 和ProcessTestObject 的区别,他们的作用是什么~!

[ 本帖最后由 flying32 于 2008-4-22 18:12 编辑 ]

flying32 发表于 2008-4-23 17:52:03

查看了一些资料,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));

[ 本帖最后由 flying32 于 2008-4-23 17:53 编辑 ]
页: [1]
查看完整版本: 请教TestObject,ProcessTestObject,RootTestObject的区别