51Testing软件测试论坛

标题: 请教TestObject,ProcessTestObject,RootTestObject的区别 [打印本页]

作者: flying32    时间: 2008-4-22 18:11
标题: 请教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
查看了一些资料,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 编辑 ]




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2