Forum Discussion
My setup:
I have a VM, and I will only use user 'UserX' to log into the machine to run the automation.
I have a batch file, which contains this statement only
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
Running this batch file, will disconnect user 'UserX' that's logged on, but the session will remain active.
I have a task schedule setup on the VM, which I can trigger from my local machine using Computer Management (via Connect to another machine option) application. The task schedule runs a PowerShell script, similar to a batch file, which runs SessionCreator using parameters /UseActiveSession and /ScreenResolution:"1920*1080" (or I can run TestExecute)
Running:
From when the VM is restarted - I log onto the VM using user 'UserX', I then run the tscon batch file to disconnect 'UserX'. I then run the task schedule from my local machine, will which run SessionCreate (or TestExecute) on the VM using the active sessions of user 'UserX'.
If I log on the VM using 'UserX' and look at Task Manager, Users tab. I will see two active sessions.
- sandysang2 years agoContributor
Hi rraghvani
Thank you for you kindly answer
I think the different is that I use testcomplete.exe to run test, not set the screen size, am not sure whether it is impact
and I find the root cause is that : when disconnect function is open, the windows application about company can not connect to database automationally.
- kakabubu2 years agoContributor
I can't get it.
#1. Are you running the tests on your local machine (Machine_1)?
Or
#2. Are you running the tests on another local machine (Machine2), where you are connected by RDP from (Machine_1)?
IF your case is #2
THEN you should configure these regedit staff on Machine_1 where the RDP session is opened to the Machine_2
Also, did you try the solution with WSL? Works like magic for me.
My fault I send you the wrong script in the previous comment.I actually use the inline script in the YAML file:
- bash: | remmina #INSERT YOUR PATH TO .remmina SESSION CONFIG FILE HERE displayName: Take RDP session on WSL timeoutInMinutes: 1 continueOnError: true
It will always fail by timeout unfortunately, or last forever if you not using the timeout property, so that's why the continueOnErro is here. I just did not invest enough time to make a proper script that will release remmina process and continue the pipeline
Related Content
Recent Discussions
- 7 hours ago