Forum Discussion
AlexKaras
11 years agoChampion Level 3
Hi Alexandra,
> Probably I forgot to explain my task.
Oh, sorry for not been a clairvoyant...
BTW, it usually helps when people mention at least TestComplete version they are using and what type of application they are testing...
Nevertheless, if you need to check whether some object exists or not, you should use one of the WaitXXX methods (e.g. WaitProcess(), WaitWindow(), WaitChild(), WaitPanel(), etc. see TC's help for more details) with the timeout parameter set to zero or some small delay (e.g. 500ms) and then check if the sought for object exists or not.
Pseudocode sample:
Set w = process.SomeWindow
Set obj = w.WaitChild("Button_OK", 500)
If (obj.Exists) Then
...
Else
...
End If
> Probably I forgot to explain my task.
Oh, sorry for not been a clairvoyant...
BTW, it usually helps when people mention at least TestComplete version they are using and what type of application they are testing...
Nevertheless, if you need to check whether some object exists or not, you should use one of the WaitXXX methods (e.g. WaitProcess(), WaitWindow(), WaitChild(), WaitPanel(), etc. see TC's help for more details) with the timeout parameter set to zero or some small delay (e.g. 500ms) and then check if the sought for object exists or not.
Pseudocode sample:
Set w = process.SomeWindow
Set obj = w.WaitChild("Button_OK", 500)
If (obj.Exists) Then
...
Else
...
End If
Related Content
- 12 years ago
- 12 years ago
Recent Discussions
- 14 hours ago