现在的位置: 首页 > 综合 > 正文

RFT笔记

2018年04月30日 ⁄ 综合 ⁄ 共 950字 ⁄ 字号 评论关闭

1.RFT中的XXXhelper类,通过“getMappedTestObject”来返回对象库中的对象。getMappedTestObject的定义为

com.rational.test.ft.object.map.SpyMappedTestObject getMappedTestObject()

Provide access to the TestObject related information.

 

Returns:
com.rational.test.ft.object.map.SpyMappedTestObject if the TestObject is MappedTestObject.
Detail description:
Returns the mapped test object if this is a mapped-object reference object, otherwise null.
Mapped Test Object are TestObjects that are obtained from the object map.
Example:
SpyMappedTestObject smto = classicsJava().getObjectReference().getMappedTestObject();

具体例子为:

protected BrowserTestObject browser_htmlBrowser()
 {
  return new BrowserTestObject(
                        getMappedTestObject("browser_htmlBrowser"));
 }

其中:(1)参数为对象库中的名称(2)创建对象的参数可以为getMappedTestObject("browser_htmlBrowser")

 

2.测试对象的类型可以在Helper中查看,如上述例子的 BrowserTestObject,可以自己定义一个对象然后针对这个对象写一些方法。

3.不要保存任何对对象库的修改(Do not save any changes you may have made

4.利用callScript("脚本名称')来调用其他的脚本。此方法是RatinalTestScript 类中的一个方法。可在脚本中直接使用。

抱歉!评论已关闭.