views:

1592

answers:

3

I'm currently modifying a Java script in Rational Functional Tester and I'm trying to tell RFT to wait for an object with a specified set of properties to appear. Specifically, I want to wait until a table with X number of rows appear. The only way I have been able to do it so far is to add a verification point that just verifies that the table has X number of rows, but I have not been able to utilize the wait for object type of VP, so this seems a little bit hacky. Is there a better way to do this?

Jeff

+2  A: 

No, there is not a built-in waitForProperty() type of method, so you cannot do something simple like tableObject.waitForProperty("rowCount", x);

Your options are to use a verification point as you already are doing (if it ain't broke...) or to roll your own synchronization point using a do/while loop and the find() method.

The find() codesample below assumes that doc is an html document. Adjust this to be your parent java window.

TestObject[] tables = doc.find(atDescendant(".rowCount", x), false);

If you are not familiar with find(), do a search in the RFT API reference in the help menu. find() will be your best friend in RFT scripting.

Tom E
to save you time, it's on this page: http://publib.boulder.ibm.com/infocenter/rtnlhelp/v6r0m0/index.jsp?topic=/com.rational.test.ft.help/com/rational/test/ft/script/RationalTestScript.html
Thr4wn
+1 the RFT info center is a great online resource.
Tom E
A: 

You can do 1 thing.... you can try getting the particular property and check that you are getting the desired value of that. if not then iterate in a IF loop.

ex

while(!flag){

if(obj.getproperty(".text").equals("Desired Text")){

flag = true

} }

A: 

use getobject.gettext();

Rational