I want to take a screen shot of application when error occurs & save it in a specific folder. Below code works but it doesnt take a screen shot of application, it takes a screen shot of QTP Code screen.
Function CaptureImage()
Dim Date_Time
Dim Myfile
Date_Time=Now()
Myfile= Date_Time&".png"
Myfile = Replace(Myfile,"/","-")
Myfile = Replace(Myfile,":","-")
Myfile= "C:\"&Myfile
Desktop.CaptureBitmap Myfile, True
End Function
Best Solution
This should work.