TestComplete could not recognise controls of WPF application started with impersonation
In our test framework, we use Connected Application feature to wrap all TestComplete functions in C# solution with following requirements:
1) we would like to avoid using TestComplete project file
2) we need to start the tested application using impersonation (similar to RunAs)
But we bumped into an issue that TestComplete cannot hook into our application on some environments when we start them with impersonation:
string pathToApp = "Resources\SampleWpfApplication.exe"; ProcessStartInfo info = new ProcessStartInfo(pathToApp); info.UserName = "Administrator"; info.Password = GetSecureString("password"); info.Domain = "exampleDomain.com"; info.UseShellExecute = false; System.Diagnostics.Process.Start(info);
While it works on a majority of environments.
Also, this issue does not occur if the application is started without impersonation (while logged in to the machine using same user - Administrator@exampleDomain.com):
System.Diagnostics.Process.Start("Resources\SampleWpfApplication.exe");
How this can be fixed?
Environment details: TestComplete 11, Net framework 4.5 (tried also TC10 and .Net 4.5.1, 4.5.2). The issue constantly reproduces on this machine.