| || |
Check if an object\'s property exists
I have a function that reads several properties of an object.
My question is: Is there a way to check if a specified property exists within an object?
If I am reading the value of a property that doesn't exist, TestComplete stops with an error dialog. How can I avoid - or at least suppress - this error dialog?
Re: Check if an object\'s property exists
You can use the IsSupported method to check if a property exists. For example, if you want to see if a button has a ControlID property, you could use the below code (VBScript):
set p = sys.process("myProcess")
set w = p.frmMyWindow
if IsSupported(w.cmdMyButton,"ControlID") then
[perform certain actions]
Hope this helps,