microsoft / WinAppDriver

Windows Application Driver
MIT License
3.57k stars 1.39k forks source link

WinAppDriver cannot read element if AUT is running in remote machine without RDP #1711

Open rahul4phone opened 2 years ago

rahul4phone commented 2 years ago

I have a bamboo build in which

  1. bamboo agent creates an instance of aws ami.
  2. logs into the instance with required/set credentials.
  3. starts AUT (application under test) and WinAppdriver.
  4. executes the nunit-console with the test libraries. (all of these steps 3 and 4) are done using powershell scripts in bamboo build plan.

Now, that the tests are running under an environment which does not have a screen. WinAppDriver fails to read most of the UI elements.

I had similar situation when I would run the tests in RDP environment and minimize the window. But registry setting "RemoteDesktop_SuppressWhenMinimized" fixed that problem.

But in this current situation, there is no rdp session open, and there is no host machine that can have the registry setting. It is just the bamboo agent that is launching and logs in the remote machine (aws instance)

How can I use WinAppDriver in this scenario?

igorrecioh commented 2 years ago

Hi @rahul4phone,

This may help --> https://stackoverflow.com/a/54637038 Original source --> https://docs.microsoft.com/en-us/azure/devops/pipelines/test/ui-testing-considerations?view=azure-devops&tabs=mstest#visible-ui-testing-using-self-hosted-windows-agents

It says:

Agents that are configured to run as service can run Selenium tests only with headless browsers. If you are not using a headless browser, or if you are running UI tests for desktop apps, Windows agents must be configured to run as an interactive process with auto-logon enabled.