4

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

Sneftel
  • 40,271
  • 12
  • 71
  • 104
user17601
  • 201
  • 4
  • 7

3 Answers3

3

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
  • 2,519
  • 2
  • 17
  • 22
  • 1
    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 – Alexander Bird Jul 30 '09 at 18:19
0

You can use:

getobject.gettext();
Taryn
  • 242,637
  • 56
  • 362
  • 405
0

You can do one 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.

while (!flag) {
  if (obj.getproperty(".text").equals("Desired Text")) {
    flag = true
  }
}
LPL
  • 16,827
  • 6
  • 51
  • 95