Facing "The 'My application' window is invisible and cannot be activated" error when executing TestExecute through teamcity

StackOverflow https://stackoverflow.com/questions/19959883

  •  30-07-2022
  •  | 
  •  

Question

Background:

With TestComplete 6 we have created a project which clicks few buttons in our application and performs few tasks. To automate it we have created a .bat file which installs our application (desktop) executes testexecute.exe in silentmode and uninstalls the application. This .bat file works fine when we execute it locally.

But when we execute this .bat file on a remote machine (teamcity agent) through teamcity I get "The 'My application' window is invisible and cannot be activated" error. Any UI action I try to execute fails because my application window in visible. It works fine till installing and starting my application, but once the application is started it can't execute any GUI task. This weird behavior raised few doubts.

  1. Why testexecute is unable to interact with the GUI?
  2. Does the user account which teamcity uses to run testexecute.exe need special privileges on that machine?
  3. How to execute TestExecute.exe on a remote machine and what things I need to take care of while doing it?
Was it helpful?

Solution

  1. The TeamCity agent works as a system service which does not have access to GUI. This means that all processes invoked by it do not have access to GUI as well.

  2. You can check the 'Run interactive' box for the agent service in the Services snap-in. However, you will still have to login to the machine in order to make the system to draw GUI and this will not guarantee that TestExecute will have enough permissions to access this GUI without any problems.

  3. You need to find a way to run TeamCity build agent as an interactive app, not as a service.

You can also find more information on this topic here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top