Waiting for Object State Changes
I have a 'Play' button that need to be click in order to trigger data.The data triggered only once so it happen really fast.When i run testcomplete to execute it,it return error like this
"The toolbar item 'Play' was clicked, but the specified state was not set up"
I assume that using the 'Waiting for Object State Changes' code would help.
example of the code :
Set btn = Sys.Process("MyApp").Window("TMainFrm","MyApplicat ion *").Child(2)
While Not btn.Enabled
aqUtils.Delay 1000 ' 1 sec delay
Can anyone help explain me the code.What it means by ("MyApp") and ("TMainFrm","MyApplication *").
Re: Waiting for Object State Changes
MyApp is the process that you are testing. Usually the applicationname. You can find this processname easily in the objectbrowser or you could record a small script, only click the button you want to test and stop the recording: you will now see how TC identifies your button, the processname will be in there. Or you can look it up in the object browser.
TMainFrm is a dummy showing the name of the frame or window the button is actually on, this window is recognised by it's 2 attributes: name and caption, the caption in this case is "MyApplication".
In a clearer example: suppose you wanted to test the windows calculator. The MyApp process would be 'calc' (look in the object browser, you will see this is the process name for the calculator, it corresponds with the 'myApp' indication in the example), the windowname is 'CalcFrame' (this corresponds with the TMainFrm indication in the example) and the caption is Calculator, this you can see on screen in the window title. (that corresponds with the "My application *";