I am running SAP GUI script automation on a Windows VM. When I am disconnecting from the remote desktop, I am running below command on a batch file, to disconnect and keep a virtual session of the current user.
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
Earlier the resolution was not an issue for the GUI scripts I executed. But this time, when I execute the script while logged into the machine, the SAP login screen and the rest of the SAP windows launched on full-screen mode, to match the screen size of my laptop. But, when I execute the above batch file, the screen area gets small and the script is unable to find the element below the visible area, as it needs to scroll down.
This is a screenshot captured during a timeout.
If I log into this vm while, it is running (in the middle of the virtual session), I get the same window as below.
But, if I run this while logged into the machine, it just gets launched full screen. I am using SAP client 770.
I don't have permission to change to screen resolution. Is there any way I can fix this issue?