I have written function to capture screenshot when error occured. I am running QTP scripts on remote desktop, and I close remote session. However I am getting the black screen for the captured screenshots.
Ok, so if I am not wrong, solution of 'caffeine' will also not work. Because, though we install 'caffeine' on remote machine, as soon as we take its remote desktop, the actual machine gets locked. So, after we close the remote session the desktop will be locked.
In that case you need to have caffeine in local as well as in remote.
but if you have the admin access in remote you could disable the screensavers/sleep mode (usually in RDM we will be having admin access)