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

I fail to run widows appium sample test #557

Open
ligvigfui opened this issue Dec 19, 2024 · 5 comments
Open

I fail to run widows appium sample test #557

ligvigfui opened this issue Dec 19, 2024 · 5 comments

Comments

@ligvigfui
Copy link

ligvigfui commented Dec 19, 2024

I downloaded every item nessesery, am running the windows application driver and trying to run the up to date sample UI tests.
WAD produces this:

Accept: application/json; charset=utf-8
Content-Length: 143
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: selenium/4.17.0 (.net windows)
X-Idempotency-Key: 40256989-53a1-4aaf-9c68-867e94fd5e4a

{"capabilities":{"firstMatch":[{"platformName":"Windows","appium:app":"com.companyname.basicappiumsample","appium:automationName":"windows"}]}}
HTTP/1.1 400 Bad Request
Content-Length: 141
Content-Type: application/json

{"status":100,"value":{"error":"invalid argument","message":"Bad capabilities. Specify either app or appTopLevelWindow to create a session"}}

I get this error from maui-samples\9.0\UITesting\BasicAppiumNunitSample\UITests.Windows\AppiumSetup.cs:line 34

OpenQA.Selenium.WebDriverArgumentException: 'Bad capabilities. Specify either app or appTopLevelWindow to create a session'

What am I doing wrong? Might the sample app be broken?

@jfversluis
Copy link
Member

What version or WinAppDriver are you using? Make sure that it its version 1.2.1 specifically.

@ligvigfui
Copy link
Author

It is 1.2.1

@jfversluis
Copy link
Member

jfversluis commented Dec 20, 2024

Just tried this with the code here and my setup on Windows 11 and it all works as intended. So it has to be some kind of configuration thing on your machine I'm afraid.

As of .NET 9 the default is to produce unpackaged apps for Windows. Maybe that is a factor here?

@ligvigfui
Copy link
Author

I am not entirely sure about what you are refering to but I tried to pack the sample app in visual studio and run the test after that. I get the same
Bad capabilities. Specify either app or appTopLevelWindow to create a session
error

@ligvigfui
Copy link
Author

I also just tried to set the Create Packaged App propery under windows targets settings to true to no avail. I received the same error.
I really want to do TDD with my app so this working would mean the world to me.

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

2 participants