HTTP/1.1 404 Not Found WinAppDriver unable to connect to App using AppID
See original GitHub issueHi! I am trying to connect play around with Calculator’s UI using Winappdriver in Python. My simple python code is :-
from appium import webdriver
desired_caps = {}
desired_caps["platformName"] = "Windows"
desired_caps["app"] = "Microsoft.WindowsCalculator_8..some_characters..!App"
desired_caps["deviceName"] = "WindowsPC"
#desired_caps["newCommandTimeout"] = 60
driver = webdriver.Remote("http://127.0.0.1:4723/", desired_caps)
I am starting WinAppDriver.exe and it starts successfully:
C:\Program Files\Windows Application Driver>WinAppDriver.exe
Windows Application Driver listening for requests at: http://127.0.0.1:4723/
Press ENTER to exit.
But it doesn’t work and throws this error :-
Python throws selenium.common.exceptions.WebDriverException
with no message and WinAppDriver shows
POST //session/ HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Content-Length: 352
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.0 (python windows)
{"capabilities": {"firstMatch": [{"platformName": "Windows", "appium:app": "Microsoft.WindowsCalculator_8..some_characters..!App", "appium:deviceName": "WindowsPC", "appium:newCommandTimeout": 60}]}, "desiredCapabilities": {"platformName": "Windows", "app": "Microsoft.WindowsCalculator_88..some_characters..!App", "deviceName": "WindowsPC", "newCommandTimeout": 60}}
**HTTP/1.1 404 Not Found**
I have tried with few other app ids or direct path to the exe instead of the app id, nothing seems to be working. It’s the first step towards using find_element_by_name calls but I am not able to proceed further due to this error. Could someone please help?
Installed Win App Driver :-https://github.com/Microsoft/WinAppDriver/releases Installed pip install Appium-Python-Client Installed Windows SDK Python Version 3+ Developer Mode is enabled,
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top GitHub Comments
@jewilder: I tried the command that you shared. Still the result is same - HTTP/1.1 404 Not Found
After some hit and try, I found issue is because of extra forward slash in the input URL.
webdriver.Remote(“http://127.0.0.1:4723/”, desired_capabilities=desired_caps) ==> This will throw 404 Not Found
webdriver.Remote(“http://127.0.0.1:4723”, desired_capabilities=desired_caps) ==> This works perfectly.
May be this is the issue even for @Urvika-gola, because I can see even she has extra forward slash in her input URL.
Does anyone faced following issue?
{"status":100,"value":{"error":"invalid argument","message":"Bad capabilities. Specify either app or appTopLevelWindow to create a session"}}