如何阻止远程虚拟机自动锁屏从而避免Ranorex测试失败

本文介绍如何确保使用Ranorex进行远程测试时,即使断开远程桌面连接(RDP),也能保持远程会话不被锁定。通过创建批处理文件并启用管理员权限运行,可以维持远程机器解锁状态,使测试能够顺利执行。

How do I make sure that my user session keeps unlocked if I close my remote session?

Ranorex Remote requires an active user session to run tests on a remote machine. You can connect to a remote machine using a remote desktop connection (RDP). As long as this remote connection is active, the remote machine is unlocked and tests can be executed. If you disconnect the RDP session, your remote machine will be locked. As no GUI is available in locked mode, your remote tests will fail.

Ranorex Agent shipped with Ranorex 6.0.1 and later includes the setting 'Keep Session Active', which is enabled by default. So no further steps are required.
Find more information in section Configure Ranorex Agent.

To keep the remote session unlocked even if you've disconnected the RDP session in Ranorex 6.0, please follow these instructions: 

 

  1. Create a batch file on your remote machine and insert the code below:
    for /f "skip=1 tokens=3 usebackq" %%s in (
      `query user %username%`
    ) do (
     %windir%\System32\tscon.exe %%s /dest:console
    )
  2. Save this batch file on the desktop of your remote machine and name it: 'KeepSessionOpen.bat'.
  3. If you need to disconnect the RDP session, you can now simply run this batch file using administrator privileges and your remote machine will remain unlocked. 

 

Note: As this mechanism will keep your remote machine unlocked even if you've disconnected your RDP session, an essential security mechanism is now disabled. Please beware that your remote machine can now easily be accessed as the system security is disabled. We advise you to not store sensitive data on your remote machine.

转载于:https://www.cnblogs.com/egoechog/articles/RanorexInRemoteSessionWithoutScreenLock.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值