Forum Discussion
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.
- AlexKaras7 years agoChampion 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.
Related Content
- 12 months ago
- 3 years ago
Recent Discussions
- 16 hours ago