.getProperty("style")
输出 TestObject(Ref:RemoteProxyReference{testContext:af4e390002a336, objectId:3171, testObjectClass:TestObject})
而 to[0].getProperties()
输出出现键“style”的文本哈希 {... , style=DISPLAY: none, oncontrolselect=null Object, rowSpan= 1、.....}
如何获取具有键样式的属性的值?
这是我的代码示例...
TestObject[] to=null;
RegularExpression findRegExp1 = new RegularExpression(find_arguments[1], false) ;
RootTestObject root = getRootTestObject();
to = root.find(atDescendant(find_arguments[0],findRegExp1),false);
System.out.println(to[0].getProperty("style"));
System.out.println( to[0].getProperties());
这两种方法都是标准 RFT 方法。更多信息请访问IBM Rational Functional Tester API Reference
最佳答案
System.out.println(to[0].getProperty("style"));
这会根据 to[0].getProperty()
的值调用 toString()
。 getProperty()
返回的对象可能具有检索各种属性(例如文本值)的方法,但会生成您在简单的 toString()
中看到的输出。
您必须在 RFT 文档中对此进行研究,以确定哪种方法可以提供您想要的数据。
关于java - 如何从 .getProperty ('style"中获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10492854/