In order for your TestLeft tests to be able access the tested application, they must have the same or higher privileges than the application under the test has —
Even if you log in to the operating system using an administrator account, the applications that you will run will not necessarily have administrator rights.
When you run your tests from a user account, they will not have access to some application processes, because they need administrator privileges for this.
Even if your tests and your tested application are running under the same user account, they may have different security permissions.
To test applications, the application that contains TestLeft test commands (your assembly and your test runner, for example) must have the same or higher privileges than the tested application has:
If a tested application has user privileges, tests must have either user or administrator privileges.
If the tested application has administrator privileges, tests also must have administrator privileges.
Launching TestLeft With Administrator Permissions
To launch TestLeft with administrator privileges, right-click the product’s shortcut and select Run as administrator from the context menu.
When you run tests on your local computer, the application from which you run the tests launches TestLeft automatically under the same account. To run tests with administrator permissions, launch the applications that run your test code with administrator permissions.
When you launch an application with administrator privileges, the operating system asks for your permission for the run. You cannot automate closing this dialog. You can close the dialog manually or you can configure the User Account Control settings so that Windows does not show the dialog ( changing the settings will impair the security):
Click Start and then click Control Panel.
In the Control Panel search box, type User Accounts and then select the User Accounts applet.
In the User Accounts window, click Turn User Account Control on or off.
The operating system will display a dialog box asking for your permission to continue. Click Continue.
Clear the Use User Account Control (UAC) to help protect your computer check box and press OK.
Close the User Accounts window.
Restart your computer.
The operating system will not display confirmation dialogs when you launch an application with administrator privileges.
Launching Tested Applications
When you launch a tested application from a test, the application gains the same privilege level as the test.
TestLeft Features That Require Administrator Permissions
You will need administrator permissions to run tested applications under another user account from tests.