Appium returns 'The requested resource could not be found' (404)
Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resourceShort answer
The client is calling a URL the server does not serve. Appium 2 and later listen at the root path, not at /wd/hub, unless you start the server with a base path. Point the client at the same path the server uses, or start Appium with --base-path=/wd/hub.
Fix it fast
1Find out which cause you have
Compare two things: the server URL your test code uses, and the flags Appium was started with (especially --base-path).
ps aux | grep -i "[a]ppium" grep -rn "4723" .2Match what you see, then jump to its fix
- 1
Your code connects to http://localhost:4723/wd/hub, and Appium was started without a base pathThe client still uses the Appium 1 address /wd/hubFix - 2
Appium was started with --base-path (or a config file sets it) and the client URL has no such prefixThe server has a custom base path the client does not useFix
- 1
What does the error look like?
Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resourcehttp://localhost:4723/wd/hub
Cause 1 of 2
The client still uses the Appium 1 address /wd/hub
1Check
In Appium 1 the default server URL ended in /wd/hub. In Appium 2 the default base path is empty, so the server answers at http://localhost:4723/ and /wd/hub returns 404.
grep -rn "wd/hub" .2Fix
Change the URL in your tests to the root, or restore the old prefix on the server.
# client: use http://127.0.0.1:4723/
# or keep the old URL and start the server like this:
appium --base-path=/wd/hub3Verify
Start a session; it no longer fails with 404.
grep -rn "4723" .Confirmed by appium.io
Cause 2 of 2
The server has a custom base path the client does not use
1Check
The --base-path option sets the prefix for all webdriver routes on the server. The default is an empty string, so any other value must also appear in the client URL.
ps aux | grep -i "[b]ase-path"2Fix
Use one base path on both sides: either add the same prefix to the client URL, or start the server without the flag.
# server started with: appium --base-path=/automation
# client URL must be: http://127.0.0.1:4723/automation3Verify
A new session starts through the client URL.
ps aux | grep -i "[a]ppium"Confirmed by appium.io
How do I stop it coming back?
- Keep the Appium URL in one config value that every test reads.
- Use current Appium clients and Appium Inspector, which add the appium: capability prefix for you.
- Note the base path in your CI start script next to the appium command.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
appium driver install uiautomator2 fails or the driver will not start
Error installing uiautomator2 driver
Run appium driver install uiautomator2 with the Appium server stopped, on a Node.js and npm version Appium supports (Node ^20.19, ^22.12 or 24+, npm 10+).
3 causes, each with a fixMobile apps
Capacitor does not find index.html for a Vue app inside Laravel
the web app files are not found by Capacitor after npx cap sync
Capacitor copies the folder named in webDir, and that folder must hold the final index.html.
3 causes, each with a fixMobile apps
Expo cannot start the Android emulator: spawn adb ENOENT
spawn adb ENOENT
ENOENT means the tool that launched adb could not find an executable named adb on your PATH.
3 causes, each with a fixMobile apps
npm install --global expo-cli fails, or the legacy expo-cli will not run on new Node.js
The legacy expo-cli does not support Node +17
The global expo-cli is the legacy tool: its repository is archived and read-only.
2 causes, each with a fixMobile apps
Expo says it is unable to find expo in this project
Unable to find expo in this project - have you run yarn / npm install yet?
The Expo CLI ships inside the expo package, so the project must have expo as a dependency and installed in its own node_modules.
3 causes, each with a fixMobile apps
FCM rejects the message with INVALID_ARGUMENT
HTTP 400 from fcm.googleapis.com/v1/projects/PROJECT_ID/messages:send
INVALID_ARGUMENT is HTTP 400: FCM did not accept the request parameters.
3 causes, each with a fix