Forum Discussion
In my application, when I enter the host name, it takes few seconds to check if that host is available, and then enables a button "Save Connection". Meanwhile TestComplete checks that the button is not enabled and it fails without waiting for the button to get enabled.
So I tried giving timeout option by setting "Set autowait timeout for operations". I am expecting this to give a delay so that "Save Connection" button gets enabled.
My problem here is "Set autowait timeout for operations" is not giving a delay. what should I do to give a delay here?
- cunderw7 years agoCommunity Hero
How are you checking for enabled? My guess is you are trying to check the enabled property of an object that does not exist, so you need to wait for it to exist. Without more detail or a code snippet though, cannot tell for sure.
- AlexKaras7 years agoChampion Level 3
Hi,
> Meanwhile TestComplete checks that the button is not enabled
How this is implemented in your test code?
- Soumya7 years agoOccasional Contributor
Hi,
I have attached a snapshot where I have given wait of 60000ms. Inspite of that the test case fails because it doesn't wait for 1 minute for the button to get enabled
- AlexKaras7 years agoChampion Level 3
Hi,
> it doesn't wait for 1 minute for the button to get enabled
May I wonder why do you expect that TC must wait 1 minute?
From the documentation: "Auto-wait timeout [...] specifies the number of milliseconds for the test engine to wait if the object with which the operation works is not available."
Is the button available? Yes.
Can it be clicked? Sure.
The button is disabled? That's fine. Why the engine should not click while it was explicitly commanded to click? The fact that the button is disabled is not a reason to omit the click because no one except you has any idea about your application and its implementation. Developers can implement thousands lines of code that will be executed when disabled control is clicked.
If you need to wait until the button is enabled, then you must explicitly do this. For example, by using the .WaitProperty() method. E.g.:
if (button.WaitProperty('Enabled', true, 60000))
<click button>;
else
<report that the button was not enabled within one minute>;
Related Content
- 9 years ago
- 12 years ago
- 14 years ago
- 8 years ago
Recent Discussions
- 9 minutes ago