A rational functional tester awaits the existence of an object

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

Jeff

+4
source share
3 answers

No, there is no built-in waitForProperty () method, so you cannot do something simple, for example tableObject.waitForProperty ("rowCount", x);

Your parameters should use a breakpoint, as you already did (if it did not break ...), or drill your own synchronization point using the do / while loop and the find () method.

The find() example below assumes doc is an html document. Adjust this as the parent java window.

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

If you are not familiar with find() , search the RFT API link in the help menu. find() will be your best friend in RFT scripts.

+3
source

You can do one thing: you can try to get a specific property and verify that you get the desired value. If not, then iterate over the IF loop.

 while (!flag) { if (obj.getproperty(".text").equals("Desired Text")) { flag = true } } 
0
source

You can use:

 getobject.gettext(); 
0
source

Source: https://habr.com/ru/post/1276884/


All Articles