Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What could cause WinAppDriver to exit immediately after start? #1991

Open
aries-zhang opened this issue Apr 2, 2024 · 3 comments
Open

What could cause WinAppDriver to exit immediately after start? #1991

aries-zhang opened this issue Apr 2, 2024 · 3 comments

Comments

@aries-zhang
Copy link

aries-zhang commented Apr 2, 2024

While I am trying to set up WinAppDriver to run as a different user on a CI agent, with the following command: (see my use case here: #1983)

Start-Process -WorkingDirectory "C:\Users\Public" -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" -Credential $credential -PassThru

WinAppDriver seems to exit immediately after it starts:

Windows Application Driver listening for requests at: http://127.0.0.1:4723/

Press ENTER to exit.

Exiting...

To rule out any user account related issues on the CI agent, with the same command but for notepad.exe:

Start-Process -WorkingDirectory "C:\Users\Public" -FilePath "C:\Windows\system32\notepad.exe" -Credential $credential -PassThru

it does not exit the newly started notepad process.

I'm aware that the env on the CI agent could be complicated and there might be something forcing the WinAppDriver process to exit. While it is hard to imagine what that something could be, I'm wondering if anyone else has similar experience or knows in what circumstances WinAppDriver could print out "Existing..." and exits?

Also, is the actual code that build WinAppDriver.exe in this repo? I was trying to search "Existing..." but did not find any related code in this repo?

@anunay1
Copy link

anunay1 commented Apr 3, 2024

You need to use double slash in the path for winappdriver

@aries-zhang
Copy link
Author

Thanks @anunay1 , double slash doesn't seem to be the cause of exiting. I managed to work it around by running another C# WinForm app which starts WinAppDriver once it starts. This way I can start the WinForm app as the non-admin user and then WinAppDriver inherits the runas user and does not exit, although I still didn't figure out why WinAppDriver exits immediately when it is directly started by Start-Process.

@gakera
Copy link

gakera commented May 14, 2024

I'm having the same problem and this issue also seems to address this: #588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants