Forum Discussion
- aPrivettOccasional Contributor
Here's a solution I use in keyword testing.:
- Start a report running which might take up to 10 minutes to display in Crystal Reports Viewer
- Property Checkpoint on Aliases.Activity.ReportPreviewForm.ReportPanel.CrystalReportViewer.PageView.TabControl.DocumentControl.PageControl to see if it is enabled with Auto-wait of 600,000ms (10 minutes)
- Property Checkpoint again to see if it is Visible with autowait of 60,000ms (1 minute)
- Property Checkpoint again to see if it is VisibleOnScreen with autowait of 60,000ms
- Property Checkpoint Aliases.Activity.ReportPreviewForm to see if it is Enabled with autowait of 600,000ms
- Property Checkpoint Aliases.Activity.ReportPreviewForm to see if it is Exists with autowait of 600,000ms.
If any of the Property Checkpoint fails, the whole test run fails, which is what I want. No need to wait for the rest of the report to run when something is wrong with the application data.
Why wait till the end to Checkpoint at the Form level (steps 5 and 6) you wonder?
Days of trial and error led me to this order of operation. We are running a very old version of the Crystal Reports Viewer which may account for the oddity. It is totally reliable on several hundred different kinds of reports for about 3 years now, every day. I put this code in a keyword test that called by "Run Keyword Test" for every report.
- AlexKarasChampion Level 3
Yes, your scenario describes what I and Robert were talking about.
The only note that I have (yes, I understood that the mentioned sequence works reliably for you and you well may not want to change something in it) :
I would swap steps 5 and 6.
The reason for this is that if the object was found (i.e. the object was recognized by TC and found in its Object Tree), than its .Exists property is set to true. If the object was not found, than .Exists is false and any other property is not guaranteed to exist.
The above means that if step 5 succeeds (form is enabled), then step 6 must definitely succeed (because the form exists and contains at least .Enabled property).
P.S. Oh, and even more, if step 2 (that references Aliases.Activity.ReportPreviewForm.ReportPanel...) succeeds, then step 6 must succeed as well, because it references Aliases.Activity.ReportPreviewForm that was successfully resolved on step 2.
- cunderwCommunity Hero
Can you provide more information about what exactly is not working? How are you using it? We need more information to be able to help.
- SoumyaOccasional Contributor
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?
- cunderwCommunity 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.
- AlexKarasChampion Level 3
Hi,
> Meanwhile TestComplete checks that the button is not enabled
How this is implemented in your test code?
- SoumyaOccasional Contributor
- aPrivettOccasional Contributor
I have similar issues. Be sure to post what fix actually worked.
Also, there's more detail at https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-state-changes.html
- tristaanogreEsteemed Contributor
The fix is... there is no fix... Auto-Wait Timeout only has to do with whether or not an object exists... visibility, enabled, disabled, etc., are not controlled by Auto-Wait Timeout. To do those, as you linked, you need to do "WaitProperty" type calls and other similar checks to determine other properties of objects.
Related Content
- 13 years ago
- 2 years ago