Save a Screenshot of Application window
Hello, I am fairly new to TestComplete and have been exclusively working with Keyword Tests. I'm trying to take a screenshot of an application window and then save that file to a folder on my computer. I've listed the attempts I've made below:
1. I tried incorporating the Snipping Tool app into my test recording. I received the following error: "The object 'ScreenClippingControl' does not exist"
2. I tried using the PrintScreen button in my test recording but it defaulted to the Snipping Tool app. Same problem as #1.
3. I tried using the Post Screenshot operation in my test but it only posts a picture to the test log. I want a .png or .jpeg of the screenshot downloaded to a folder on my computer.
4. I attempted to convert my Keyword Test into a script. After searching through this forum, I tried using the SaveToFile method. No file was generated in the folder I specified. My code is below (CAPS signifying placeholders for client-sensitive material):
var pic = MYPHOTO.Picture();
pic.SaveToFile("C:\Users\MYNAME\Desktop\Test Docs\Test Screenshots")
5. I attempted to add another code solution I found on the forums. I received a "TypeError: This is not a function" when I entered the following code:
Sys.Desktop.Picture.SaveToFile("C:\Users\MYNAME\Desktop\Test Docs\Test Screenshots\Desktop.jpg")
In summary, I'm certain I'm missing a crucial step but I'm not sure what I'm doing wrong and what option is going to produce the desired outcome. Can any TestComplete experts help out this beginner?
I've had a similar issue too. I suggest you open a ticket via https://support.smartbear.com/testcomplete/message/