Window and Element Capture on Wpf application returns blank image

7 posts, 0 answers
  1. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 06 Jan 2014 Link to this post

    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?
  2. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 06 Jan 2014 Link to this post

    Sorry

    Not sure what's happening but it has started to work after hours of trying and no code change.
  3. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 06 Jan 2014 Link to this post

    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?
  4. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 06 Jan 2014 Link to this post

    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?
  5. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 08 Jan 2014 Link to this post

    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
  6. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 24 Mar 2014 in reply to Velin Koychev Link to this post

    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
  7. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 26 Mar 2014 Link to this post

    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
     
Back to Top