51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2945|回复: 1
打印 上一主题 下一主题

请教TestObject,ProcessTestObject,RootTestObject的区别

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-4-22 18:11:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 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 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-4 19:22 , Processed in 0.063009 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表