Forum Discussion
aPrivett
7 years agoOccasional 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.