RootTestObject root = RootTestObject.getRootTestObject();
//通过匹配ViewButton的属性来找到该对象
TestObject to[] = root.find( RationalTestScript.atDescendant(
".class", ".Pagetab", ".name", "View" ) );
return new GuiTestObject (to[0]);
}
return viewButton;
}
public GuiTestObject getHomeButton(){
if(homeButton == null ){
//通过匹配HomeButton的属性来找到该对象
RootTestObject root = RootTestObject.getRootTestObject();
TestObject to[] = root.find( RationalTestScript.atDescendant(
".class", ".Pagetab", ".name", "Home" ) );
return new GuiTestObject(to[0]);
}
return homeButton;
}
}
CacheVer1.java: 使用缓存机制完成操作。
代码 4. CacheVer1.java
文章来源于领测软件测试网 https://www.ltesting.net/