locked
On exceptions, UI Automation or CUIT is taking screenshots of the wrong screens RRS feed

  • Question

  • On exceptions, UI Automation or CUIT is taking screenshots of the wrong screens

    During test runs, if there is an exception, you can see a screenshot attached to the Test Results. However, the screenshot is rarely of the screen that was up when the error occurred. I have noticed for my application, that it is usually of the logon screen, even if the error occurred on a modal dialog in a logged in application window.

    Can anyone explain this screenshot mechanism and if there are any ways to make it better? I'm inclined to leave the application alone in the case of an error so that a developer can take a look at it live.
    Thursday, January 28, 2010 4:32 PM

Answers

  • Hi, screenshot is produced for every playback failure and not for assertion failure. While doing playback, before declaring a failure, retries are done. But a screen shot is generated for every failure.
    So my explanation for your above google search issue is, there was an intermittent failure(search or action) and a corresponding screenshot was generated but on a retry it passed. So playback went ahead. Then the assertion failed.

    Saturday, February 13, 2010 10:07 AM

All replies

  • Looks like you are running into some bug.  The screenshot should be of the screen at the time of step failure.  If you can give repro steps, we can dig into it.

    Thanks.
    http://blogs.msdn.com/gautamg
    Friday, January 29, 2010 5:40 AM
  • Reproducing the problem in a manner I can write about is going to be hard... Can you describe the screenshot process? It might give me a better way to repro the issue if I understand the playback lifecycle and where/what handler takes the screenshot.
    Friday, January 29, 2010 7:19 PM
  • When the playback fails, it raises Playback.PlaybackError event.  The screenshot is taken just before this event is raised by the playback module.

    Thanks.
    http://blogs.msdn.com/gautamg
    Tuesday, February 2, 2010 12:10 PM
  • Hi,

    Any updates on the above discussed issue?
    Actually I also ran into a similar issue. I just recorded a Google search and asserted for the presence of a particular InnerText for the first link returned by the search. I deliberately changed the InnerText to some non-existing value to get a failure. I got the failure but the screenshot was of the Google search's home page rather than that of the search results page.

    Regards,
    Pankaj
    Thursday, February 4, 2010 9:39 PM
  • I have tried with the recording of google search and then assert on the inner text of first hyper link, But could not repro the issue.
    Can you send us your test project in which you have recorded your stuff.
    Friday, February 5, 2010 9:07 AM
  • Hi,

    I am also not able to reproduce it now. I stumbled across this issue a couple of times while giving a training. But the same scenario is working fine now.

    Thanks,
    Pankaj
    Saturday, February 13, 2010 6:22 AM
  • Hi, screenshot is produced for every playback failure and not for assertion failure. While doing playback, before declaring a failure, retries are done. But a screen shot is generated for every failure.
    So my explanation for your above google search issue is, there was an intermittent failure(search or action) and a corresponding screenshot was generated but on a retry it passed. So playback went ahead. Then the assertion failed.

    Saturday, February 13, 2010 10:07 AM
  • Thanks Thejkumar. This sounds reasonable.

    Regards,
    Pankaj
    Wednesday, March 10, 2010 12:01 PM