google搜索 51Testing站内搜索                    软件测试门户 | 软件测试培 训 | 文章资料精选 | 软件测试论坛 | 软件测试博客 | 测试招聘求职 
打印

请教TestObject,ProcessTestObject,RootTestObject的区别

本主题由 fishy 于 2008-4-23 16:35 移动

请教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 编辑 ]

TOP

查看了一些资料,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 编辑 ]

TOP

 
当前时区 GMT+8, 现在时间是 2008-7-6 17:28Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹