Forum Discussion
I have found best results using WaitChild or WaitAliasChild(if you use NameMapping Aliases).
Directly checking Exists on an object throws an error while Delay() will always add fixed additonal time to the script while running.
WaitChild over comes both of these issues.
Here is more information on WaitChild: https://support.smartbear.com/viewarticle/72783/
- NisHera9 years agoValued Contributor
Also be aware that even though some objects exists may not visible
in which case TC coulc not use or operate the object
It is usefull in some case check visible or VisibleOnScreen is true
along with Exists see this- abrar229 years agoFrequent Contributor
Hi,
Thanks for you replies.
So I have WBtn_ABC in ny Name mapping (Aliases.Product.TransitionBox.PriceTicker.WBtn_ABC)Can i just use
(WBtn_ABC.Exists &&WBtn_ABC.VisibleOnScreen)
?
Thanks
A
- djadhav9 years agoRegular Contributor
If you do this
(WBtn_ABC.Exists &&WBtn_ABC.VisibleOnScreen)
WBtn_ABC.Exists can throw an error and stop the script if the object does not exist.
I would do it this way:
IF Aliases.Product.TransitionBox.PriceTicker.WaitAliasChild("WBtn_ABC", 10000).Exists THEN IF Aliases.Product.TransitionBox.PriceTicker.WBtn_ABC.VisibleOnScreen THEN 'Do something because it is visible on screen END IF ELSE Log.Error("The WBtn_ABC object does not exist") END IF
NOTE: The number 10000 means I would like to wait 10 seconds to check if the object exists. You can change it as required.
Related Content
- 5 months ago
- 2 years ago
Recent Discussions
- 49 minutes ago
- 2 days ago