Reputation: 11121
.getProperty("style")
outputs TestObject(Ref:RemoteProxyReference{testContext:af4e390002a336, objectId:3171, testObjectClass:TestObject})
while to[0].getProperties()
outputs text hash where key "style" is presented {... , style=DISPLAY: none, oncontrolselect=null Object, rowSpan=1, .....}
How can I get the value of the property with key style?
here's sample of my code ...
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());
Both methods are standard RFT methods. More info at IBM Rational Functional Tester API Reference
Upvotes: 0
Views: 1792
Reputation: 11121
I opened a ticket with IBM support and this is the final answer:
"I have done the test in your website and confirmed the getProperty("style") output. It was a bug and has been fixed in RFT8.2.1.1. I confirmed that the getProperty method in RFT 8.2.1.1 works well."
Upvotes: 1
Reputation: 4695
I think "stlye" is a Non-Value property. As the documentation states: http://publib.boulder.ibm.com/infocenter/rfthelp/v7r0m0/index.jsp?topic=/com.rational.test.ft.api.help/ApiReference/com/rational/test/ft/object/interfaces/TestObject.html
You can find the non-value properties by calling getNonValueProperties(). You can use the getProperty method to access both value and non-value properties. If you access a non-value property, the property returns a TestObject that contains a reference to the (non-value) object in the software under test.
you cannot access the content of that property.
Open up the Test Object Inspector and look if "style" is in the Non-Value Properties panel
I just tried with IE6 on a page and cannot read the "style" property.
Upvotes: 1
Reputation: 86774
System.out.println(to[0].getProperty("style"));
This invokes toString()
on the value of to[0].getProperty()
. The object being returned by getProperty()
likely has methods to retrieve various attributes, such as the text value, but produces the output you see for a simple toString()
.
You are going to have to research this in the RFT documentation to determine which method provides the data you want.
Upvotes: 1