Forum Discussion

yurik's avatar
yurik
Contributor
9 years ago

How to start TestExecute on remote host "AsAdministrator"?

Hi,

  I'm writing a distributed test and I'm having a problem with one of the windows not working properly unless the application is started with "RunAsAdministrator".  The workaround that I've found is to start TestExecution as administrator, then it's all working good. However I need to restart TestExecution before the test, so I'm using "Restart TestComplete"  option in Task properties. Now, when I run the test on Main computer it restarts TestExecution on the remote host. But it does not start the the TestExecution in Administrator mode even though I've checked "RunAsAdministrator" checkbox in TestExecute.exe properties.

 Is there a way to force TestExecution to start in Admin mode on remote host?

 

 

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    hi,

     

    I use a schedulled task that launches the program I want (here TestExecute) "with high privileges".

    If you want to launch it manualy, you could create a shortcut that launches the task manager for this particular task.

    • yurik's avatar
      yurik
      Contributor

      Hi   ,

        What do you mean by task manager in "create a shortcut that launches the task manager for this particular task"?

        Can you give me an example?

       

      Thanks!

          Yuri

      • m_essaid's avatar
        m_essaid
        Valued Contributor

        Hi Yurik, sorry for answering in late,

         

        create an empty windows shortcut, edit its properties, then in "target" write something like in the "shortcut" tab:

        C:\Windows\System32\schtasks.exe /run /tn andHereTheNameOfTheSchedulledTask

         

         

        then click on "advanced..." and enable the checkbox "execute as administrator"

  • Hi yurik,

    In the Setting for TestExecute program you can select "Run this program as an administrator".

    - Open the Testexecute installation folder (usually C:\Program Files (x86)\SmartBear\TestExecute 11\Bin)

    - Right click on TestExecute

    - Select Properties

    - Go in the Compatibility tab

    - In the Settings panel select "Run this program as an administrator"

    - Click on "OK"

     

    The next time TestExecute will be run it will be as an administrator. Don't forget to decrease the security level to avoid prompt at starting.

     

    You may control with the Task Manager that Test Excecute is executed with "Elevated privilege".

     

    Regards,

    Christophe

    • yurik's avatar
      yurik
      Contributor

      Hi Christophe,

         I've tried "Run this program as an administrator" but the application still behaves differently: When I start the application manually it behaves, but when I start the application from a TC script running on Master machine it still misbehaves.

      I'll explain the setup one more time: The script is running in TestComplete on Master PC and starts TestExecution on the RemoteHost. TestExecution runs a script that starts the application that I'm testing. Master PC runs WIN7 , Remote host is WIN 8.

      Now, there are several ways I've found to work around this issue:

      1. If I use TestedAppObj["Run"] to start myApplication then possible workaround it to start TE with elevated privileges using Scheduled Tasks when PC boots up. However this means that if I restart TE from Master then myApplication stops behaving.

      2. If I use TestedAppObj["RunAs"], providing the Domain, Username and Password of the remote host , then myApplication behaves even if TE was started from Master PC.

       

      So it looks like myApplication has to run with elevated privileges, so even if I tick "run as administrator" for TE and myApplication executables, when I start them remotely they are still running in limited privileges (even if TaskManager shows that TE is in Elevated mode)