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 issue

The 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 of http://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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
KazuCocoacommented, Apr 8, 2021

Because appium2.0 does not have /wd/hub. You can run appium 2.0 with -pa /wd/hub or -base-path, or you could provide http://127.0.0.1:4723/ instead of http://127.0.0.1:4723/wd/hub in your client code.

e.g.:

% appium  --base-path /wd/hub
[Appium] Welcome to Appium v2.0.0-beta.12
[Appium] Non-default server args:
[Appium]   basePath: /wd/hub
[Appium]   tmpDir: /var/folders/y6/524wp8fx0xj5q1rf6fktjrb00000gn/T
[Appium] Attempting to load driver xcuitest...
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium]   - xcuitest@3.42.0 (automationName 'XCUITest')
0reactions
mittalricommented, Feb 2, 2022

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”));

        HashMap<String, String> environment = new HashMap<String, String>();
        environment.put("PATH", "/usr/local/bin:" + System.getenv("PATH"));
        builder.withEnvironment(environment);
        builder.withArgument(() -> "--base-path", "/wd/hub");


        service = AppiumDriverLocalService.buildService(builder);
        service.start();

but getting error SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [Appium] Welcome to Appium v1.22.2 [Appium] Non-default server args: [Appium] port: 55175 [Appium] Appium REST http interface listener started on 0.0.0.0:55175 [HTTP] –> GET /wd/status [HTTP] {} [debug] [HTTP] No route found for /wd/status [HTTP] <-- GET /wd/status 404 17 ms - 211 [HTTP]  [HTTP] –> GET /wd/status [HTTP] {} [debug] [HTTP] No route found for /wd/status [HTTP] <-- GET /wd/status 404 24 ms - 211

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Mobile App with Appium & WebdriverIO: "No route ...
I got rid of the problem by using this command to start Appium server in the terminal: appium --base-path /wd/hub.
Read more >
No route found for /status - Support - Appium Discuss
I 'm having the same issue. java-client 8.1.1. Appium 1.22.3. Suddenly cannot start appium service programmatically.
Read more >
appium/appium - Gitter
Shouldn't I be able to start a session with Appium Desktop and run my test the same way? I'm getting following error: [HTTP]...
Read more >
Appium server GUI returned error "No route found for /session ...
Working tweek : In, Appium inspector just add /wd/hub under field Remote Path enter image description here; Check it will start working now....
Read more >
an error occurred while trying to create a file in the destination ...
For some security update now windows doesn't allow me to install VS code updates. ... When I run VS Code as administrator the...
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