Forum Discussion

chicks's avatar
chicks
Regular Contributor
12 years ago

object properties not updated - Visible, ChildCount, VIsibleOnScreen



Rather than introduce arbitrary delays to handle timing issues, I've written a waitUntil function to which I pass other functions that evaluate as true or false....



something like:

   waitUntil(WAIT_FOR_ADD_PAY_CARD_, addPayCard_form_gone );



where WAIT_FOR_ADD_PAY_CARD is a constant for the maximum amount of time to wait for the addPayCard_form_gone function to evaluate as true.



Now on to my actual question:

I've noticed that some of the object properties such as Visible, ChildCount, VisibleOnScreen are not updated with the final values.  e.g.  I can wait 60 seconds checking if the childcount property is > 0 every second, and it will remain 0 throughout the entire minute, although it is clearly not 0 at some point.



I've also had to check that the Width property is > 0 rather than the Visible property because 'Width' gets updated correctly but Visible does not.



Is there some way I can ensure that these properties get updated properly?  Aret there some properties that are known to be trustworthy or not trustworthy?



Thanks.

  • Try to insert obj.Refresh() call for the object you are working with, or for its parent.

    Did you inspected the tested object after the failed check - does it exists, does some other propertie values changed?
  • Try to insert obj.Refresh() call for the object you are working with, or for its parent.

    Did you inspected the tested object after the failed check - does it exists, does some other propertie values changed?
  • chicks's avatar
    chicks
    Regular Contributor
    I did not know about Refresh.  That seems to be doing the trick so far.  Thanks very much!  Regards,  Curt