Right now as per default setting I am able to get screen shot for failed status but not for pass, per as per the requirement I need to attach for pass as well.
Any one please suggest any framework or function for that .
|
Right now as per default setting I am able to get screen shot for failed status but not for pass, per as per the requirement I need to attach for pass as well. Any one please suggest any framework or function for that . |
|||||||||||
|
|
This, honestly, sounds like default behavior for TestComplete by SmartBear. There's a setting that, when log entry categorized as "Error" is made (either automatically by the engine or by a deliberate "Log.Error()" call), it will capture the current desktop as an image in the log file (image below is from the project properties in the Playback option).
If the tool is TestComplete, then, all you need to do is explicitly call the "Log.Picture()" method on a successful run of a test. Insert that in your code and you have a screenshot. If you're using keyword tests, you would need to use the "Post Screenshot" operation
This will put the screenshot into your log as well in the same fashion that Log.Picture does. If your tool is not TestComplete, then I'm pretty sure there are similar functions/methods/features in other testing packages that can do the same thing. |
|||
|
|
|
Selenium should work. Not sure if Watir/Watin supports this. If Selenium doesn't cut it for you, I've incorperated SnagIt into previous automation suites for screenshots at specific times. The only downside to the SnagIt route is that it would need to be installed on whatever machine happens to be running the tests. |
|||
|
|
|
"Right now as per default setting I am able to get screen shot for failed status but not for pass" What test automation tool are you using? Most tools have the capability of taking a screenshot at any time. I use WinTask. It has a HardCopy() function that is simple to use for these types of situations. |
|||
|
|
|
I assume that you are talking about using CodedUI tests that are part of Microsoft Test Manager, which only take a screenshot on failed tests. You can write some code to capture the image and call as part of your cleanup before you close the browser. Watin has code to do this which you can see here. |
|||
|
|