After updating from Appium 1.2 to 2.0 (Beta), my test is now throwing a "[HTTP] No route found for /wd/hub/session" error
See original GitHub issueThe problem
My tests use to run fine when I was on Appium 1.2 (release), but I then updated to 2.0 (beta) because I wanted to try out these methods startPerfRecord/stopPerfRecord which are only baked into Appium 1.8 and greater, but on Appium 2.0 my test no longer run and is throwing a “[HTTP] No route found for /wd/hub/session” error immediately when initiating my test. I know it has something to do with the capabilities, but I can’t for the life of me figure it out.
I’m trying to run this test on a physical iPhone.
Some thing’s I’ve tried:
- Changing some of the capabilities by adding ‘appium:’ in front of them - E.g. appium:deviceName instead of just deviceName
- Running appium with
--base-path /wd/hub
- Using
http://127.0.0.1:4723/
in the client code instead ofhttp://127.0.0.1:4723/wd/hub
- Removing a good amount of the capabilities I have set
Environment
- Appium version: 2.0.0-beta.12
- Last Appium version that did not exhibit the issue (if applicable): 1.2
- Desktop OS/version used to run Appium: macOS 10.15.7
- Node.js version (unless using Appium.app|exe): v14.15.5
- Npm or Yarn package manager: npm
- Mobile platform/version under test: iOS 14.4
- Real device or emulator/simulator: Real Device
- Appium CLI or Appium.app|exe: Appium CLI
Details
If necessary, describe the problem you have been experiencing in more detail.
Link to Appium logs
[Appium] Welcome to Appium v2.0.0-beta.12 [Appium] Non-default server args: [Appium] tmpDir: /var/folders/l9/hjmf8hz55hqf2dnhjtbzk9r40000gr/T [Appium] Attempting to load driver uiautomator2… [Appium] Attempting to load driver xcuitest… [Appium] Attempting to load driver mac2… [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [Appium] Available drivers: [Appium] - uiautomator2@1.64.0 (automationName ‘UiAutomator2’) [Appium] - xcuitest@3.42.0 (automationName ‘XCUITest’) [Appium] - mac2@0.12.0 (automationName ‘Mac2’) [Appium] Available plugins: [Appium] - images@1.1.5 [Appium] No plugins activated. Use the --plugins flag with names of plugins to activate [HTTP] --> POST /wd/hub/session [HTTP] {“desiredCapabilities”:{“appium:udid”:“auto”,“appium:xcodeSigningId”:“iPhone Developer”,“appium:bundleId”:“com.test.app.dev”,“platformName”:“iOS”,“appium:deviceName”:“doesntmatter”,“appium:automationName”:“XCUITest”,“appium:updatedWDABundleId”:“io.appium.WebDriverAgent”}} [debug] [HTTP] No route found for /wd/hub/session [HTTP] <-- POST /wd/hub/session 404 11 ms - 211
Code To Reproduce Issue [ Good To Have ]
@BeforeClass
public static void setUp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability("deviceName", "doesntmatter");
capabilities.setCapability("udid", "auto");
capabilities.setCapability("bundleId", "com.test.app.dev");
capabilities.setCapability("xcodeSigningId", "iPhone Developer");
capabilities.setCapability("updatedWDABundleId", "io.appium.WebDriverAgent");
driver = new IOSDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@Test
public void DemoTest123() {
// navigate to the settings > about page
driver.findElementByXPath(SETTINGS_BTN_XPATH).click();
driver.findElementByXPath(ABOUT_OPT_XPATH).click();
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top GitHub Comments
Because appium2.0 does not have
/wd/hub
. You can run appium 2.0 with-pa /wd/hub
or-base-path
, or you could providehttp://127.0.0.1:4723/
instead ofhttp://127.0.0.1:4723/wd/hub
in your client code.e.g.:
i am tryin start appium code suggested.
AppiumServiceBuilder builder = new AppiumServiceBuilder();
builder.usingAnyFreePort(); // Tell builder where node is installed. Or set this path in an environment variable named NODE_PATH builder.usingDriverExecutable(new File(“C:\Program Files\nodejs\node.exe”)); // Tell builder where Appium is installed. Or set this path in an environment variable named APPIUM_PATH builder.withAppiumJS(new File(“C:\Users\Ritesh Mittal\AppData\Roaming\npm\node_modules\appium”));
but getting error SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [35m[Appium][39m Welcome to Appium v1.22.2 [35m[Appium][39m Non-default server args: [35m[Appium][39m port: 55175 [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:55175 [35m[HTTP][39m [37m–>[39m [37mGET[39m [37m/wd/status[39m [35m[HTTP][39m [90m{}[39m [debug] [35m[HTTP][39m No route found for /wd/status [35m[HTTP][39m [37m<-- GET /wd/status [39m[33m404[39m [90m17 ms - 211[39m [35m[HTTP][39m [90m[39m [35m[HTTP][39m [37m–>[39m [37mGET[39m [37m/wd/status[39m [35m[HTTP][39m [90m{}[39m [debug] [35m[HTTP][39m No route found for /wd/status [35m[HTTP][39m [37m<-- GET /wd/status [39m[33m404[39m [90m24 ms - 211[39m