This is a migrated thread and some comments may be shown as answers.

Window and Element Capture on Wpf application returns blank image

6 Answers 236 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 06 Jan 2014, 08:28 AM
Currently I am using Framework version 2013.2.1210.0 and I am having a problem capturing images of our application.

I have tried on multiple control elements and get an image exactly correct in size but white. I went right to the top of the stack and captured the Wpf Window using Manager.Log.CaptureWindow() and this gave me a screenshot of the application but displayed all white except the windows title bar which was in full colour and included the minimise/expand/close buttons. I did also try Manager.Log.CaptureDesktop() which did get the image of the application along with the desktop however this is no good to me at this level as I am trying to do some image comparison/verification of a single element.

I have tried the following with the same white image the same size as the control trying to be captured 
myControl.Capture()
Window.GetBitmap(myControl.GetScreenRectangle)

What could be happening to cause none of the application top be captured?

6 Answers, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 06 Jan 2014, 08:45 AM
Sorry

Not sure what's happening but it has started to work after hours of trying and no code change.
0
Max
Top achievements
Rank 1
answered on 06 Jan 2014, 12:04 PM
This is frustrating....
It worked after trying all the methods I mentioned above but then when I restarted my app and tried again it all stopped working as I described.

Any idea what I am doing wrong? does someone have a code sample that works they can share?
0
Max
Top achievements
Rank 1
answered on 06 Jan 2014, 04:25 PM
Problem solved.... Issue is that Telerik Test Framework Capture method doesn't like to work with multi screens. I reduced mine from 3 down to 1 and now capture works every time.

Is this something you can fix?
0
Velin Koychev
Telerik team
answered on 08 Jan 2014, 02:30 PM
Hello Max,

It is good to hear that you've been able to find the cause of this problem. It seems that you are hitting this problem that is described in our Feedback portal. You can try the proposed solution there and see if that would help.

Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 24 Mar 2014, 08:32 AM
Hi,
Sorry for taking so long to get around to trying the proposed workaround however I must let you know my findings.
I work with a docked laptop which then has 2 more screens connected by view port cables so have a total of 3 screens
my laptop screen is the far right and then screen 2 in the middle and then screen 3 on the right. In otherwords my windows screen resolution settings show 3 --> 2 --> 1
To get what you suggest to work i have to turn off my laptop screen (display 1), so loose a screen :'( and then follow your suggestions and then it works if the WPF application is running on display 3. Not exactly ideal having to turn displays on and off but i guess a work around is better than nothing at the moment. Are you planning on trying to fix it?

Thanks
0
Velin Koychev
Telerik team
answered on 26 Mar 2014, 02:31 PM
Hello Max,

Are you planning on trying to fix it?

Unfortunately this issue is outside of our control. Here is what our QA team says about this problem:
This seems to be a problem of the configuration of the extended displays, more specifically how Windows treats the active display and is beyond our control. 

You can give a try with the different options for configuration that you have with 3 monitors and see if that would help. 

Thank you for your understanding.

Regards,
Velin Koychev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Max
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Velin Koychev
Telerik team
Share this question
or