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?
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
- 12 months ago
- 3 years ago
Recent Discussions
- 16 hours ago