Question
Tech Mahindra Ltd
CA
Last activity: 21 May 2020 18:30 EDT
How to get screenshot in text adaptor
Hi,
Could you please help me to get screen shot in text adaptor screen. FYI I am using humming bird.
I tried with get screen shot method but its not work it throws error message.
If anyone has any other method to get screen shots
Regards,
Pavan G
***Edited by Moderator Marissa to change type from Pega Academy to Product; update Platform Capability tags***
There are several different ways to get a screenshot. Generally speaking, for a text adapter, you can simply record the text from the screen as that will effectively be a screenshot (albeit one in text). If you need the colors and what not or want a true image, you will need to use some C#.
If you want just the text, I believe there is a ScreenText property (it has been a while) that will output all of the screen characters. You'll need to format this as it doesn't add line breaks, so if your screen is the standard 24x80, you'd simply break every 80 characters and insert a new line.
Here is an example solution that takes a screenshot of the main window of a given process. If you have multiple instances of a process, or want a screenshot of something other than the main window, you'll need some additional logic.