question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP/1.1 404 Not Found WinAppDriver unable to connect to App using AppID

See original GitHub issue

Hi! 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:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
manju1847commented, Mar 29, 2023

@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.

0reactions
SrLeet03commented, Aug 3, 2023

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

WinAppDriver can't connect to application on Windows
WinAppDriver can't connect to application on Windows · Referring to the calculator app by 'C:\ProgramFiles\Google\Chrome\Application\chrome.exe' ...
Read more >
Microsoft Windows App - cannot record test cases due to ...
Message in cmd prompt reads “HTTP/1.1 404 Not Found Content-Length: 128. Content-Type: application/json”. No further entries are recorded.
Read more >
Issue on getting initialize notapad.exe using WinAppDriver
I'm trying to automate windows application like notepad, calculator using WinAppDriver in QAF and java ... Connection: Keep-Alive ... HTTP/1.1 404 Not Found....
Read more >
Windows application Test Automation (Part 2)
But if WinAppDriver is responding correctly, in the WinAppDriver running window there should be a response stating at the end 'HTTP 1.1/404 Not...
Read more >
How To Automate Desktops Apps Using WinAppDriver
This blog deep dives by telling you How To Automate Desktops Apps Using WinAppDriver. It also leverages WinAppDriver on HyperExecute Cloud ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found