Forum Discussion
Actually, this line of code is problematic...
Sys.Process("*").WPFObject("HwndSource: DesignerHost").Exists
If the object does not exist... how can you check the "Exists" property of a non-existent object? This is improper code. In the recent versions of TC, this is being enforced a bit more strictly. A proper code for checking this condition would be
Sys.Process("*").WaitWPFObject("HwndSource: DesignerHost", -1).Exists
The WaitWPFObject method will wait for the object to resolve... if it doesn't within the designated time out, it returns a "stub" object with an Exists property set to false. This is the best practice for checking for object existance, using a "WaitNNN" method.
See
https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/waitwpfobject-method.html
> A proper code for checking this condition would be
Sys.Process("*").WaitWPFObject("HwndSource: DesignerHost", -1).Exists
I think that it should be:
Sys.Process("*").WaitWPFObject("HwndSource: DesignerHost", 0).Exists
As per documentation, timeout that equals to -1 will wait forever, while if timeout is zero, than no wait will occur, just a check of whether or not the sought for object exists.
Everything else said by Robert is perfectly correct.
- sree20117 years agoContributor
Thank you for your suggestions
Related Content
- 12 years agoRavik
Recent Discussions
- 2 hours agoJacobjacob44