TestComplete : Unable to capture complete screenshot in the disconnected remote desktop
Hello,
I am using TestComplete Picture object to take the screenshot, save in the clipboard and then save into the excel file sheet.
Below is the sample code :-
Set oPict=Sys.Browser("iexplore").BrowserWindow(arg_BrowserID).Picture
Call oPict.SaveToClipboard()
Call func_PasteScreenshotinExcelSheet(var_ReportFileLocation,3) ( In this case 3 is the sheet id, meaning it is shored 3rd sheet)
Function func_PasteScreenshotinExcelSheet(arg_FileName,arg_SheetID)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = False
Set objWorkbook = objExcel.Workbooks.Open(arg_FileName)
Set objWorkSheet=objWorkbook.Worksheets(arg_SheetID)
objWorkSheet.Activate
objWorkSheet.Cells(intTopRange-3,1).value=strBusinessOperation
objWorkSheet.Cells(intTopRange-3,1).font.bold = True
objWorkSheet.Cells(intTopRange-3,2).value="Status: "&strBusinessOperationStatus
If lcase(strBusinessOperationStatus)="pass" Then
objWorkSheet.Cells(intTopRange-3,2).Interior.ColorIndex = 4
Elseif lcase(strBusinessOperationStatus)="fail" Then
objWorkSheet.Cells(intTopRange-3,2).Interior.ColorIndex = 3
End If
'Ws.Range("A"&intTopRange).Select
Delay(500)
objWorkSheet.Paste(objWorkSheet.Range("A"&intHeightStartRange&":"&"A"&intHeightEndRange))
objWorkSheet.Range("A1:IV200").EntireColumn.AutoFit
intHeightStartRange=intHeightEndRange+6
intHeightEndRange= intHeightStartRange+55
intTopRange=intHeightStartRange
objWorkbook.Save
Set objWorkbook=Nothing
objExcel.Quit
Set objExcel=Nothing
I am able to capture the whole image of the browser,save into clipboad and it is pasted in the excel file when I am connected to the remote desktop.
But if I disconnect the remote desktop using tscon command by running as admimistrator then it captures the part of the image which is saved in the clipboard and pasted in the excel sheet.
Below is the tscon command,which is in the batch format and run as administrator for disconnecting remote desktoop :-
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
Can you please let me know how to have the whole image captured during the disonnected remote machine?
Regards,
Nimish
Hi All,
I have found the solution which is working correctly, we need to make changes in the registry to change the resolution as per our requirement when using tscon for desktop console.
https://community.smartbear.com/t5/TestComplete-General-Discussions/Screen-Resolution/m-p/181508
Regards,
Nimish