maui-samples
maui-samples copied to clipboard
I fail to run widows appium sample test
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?
What version or WinAppDriver are you using? Make sure that it its version 1.2.1 specifically.
It is 1.2.1
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?
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
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.