Snapshot of dialog containing progress bar crashes program

Bug reports.
Dead Composer
Posts: 2
Joined: Mon Mar 09, 2009 10:54 pm

Snapshot of dialog containing progress bar crashes program

Post by Dead Composer » Mon Mar 09, 2009 11:01 pm

I have a Java application that uses SWT for windowing. The application includes several dialogs, some of which contain a progress bar (SWT class: ProgressBar) control. I am automating the application using a C# program which interfaces with the Ranorex library. Whenever I use Ranorex.ElementSnapshot to take a snapshot of a dialog containing a ProgressBar and save the snapshot to a PNG file, the PNG file is created and appears correct, but the Java program immediately crashes. According to the log file, the error is a Java Virtual Machine error (illegal access). One of the frames mentioned in the log file is the ProgressBar window procedure.

If anyone has a clue as to why this happens, please help. Thanks.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Thu Mar 12, 2009 4:31 pm

I tried to reproduce the crash with the SWT progressbar, but without success.
When exactly does your application crash ?

If you only need a picture of your dialog (and not a snapshot which also includes complete element information) try Imaging.CaptureImage() instead, which should be safe (but does not work with hidden windows)


Michael
Ranorex Team

Dead Composer
Posts: 2
Joined: Mon Mar 09, 2009 10:54 pm

Post by Dead Composer » Thu Mar 12, 2009 8:43 pm

Imaging.CaptureImage works without crashing, however, it has the disadvantage that it copies whatever is in the background at the corners of a window. This can interfere with the screenshot comparisons in the automated GUI tests I am developing. (Hidden windows are not a problem, as the screenshots are always of the window in the foreground.)

I will continue to experiment with this problem.