title: Testing Mobile App with Appium & WebdriverIO: "No route found for /session"
body: <p>I want to set up the process of <strong>automated testing</strong> of mobile applications for Android and iOS platforms (React Native) . For this I use <a href="http://appium.io/" rel="noreferrer">Appium</a> and <a href="https://webdriver.io/docs/gettingstarted" rel="noreferrer">WebdriverIO</a>. As an example, I am using existing <a href="https://github.com/webdriverio/appium-boilerplate/" rel="noreferrer">appium-boilerplate</a> codebase and a ready-made <a href="https://github.com/webdriverio/native-demo-app/releases" rel="noreferrer">application</a> for running tests. I run the application in the <strong>Android emulator</strong>. Basic settings are presented below.</p>
  <p><strong>1. Appium</strong></p>
  <p><a href="https://i.stack.imgur.com/qwYU8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qwYU8.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/Biix3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Biix3.png" alt="enter image description here" /></a></p>
  <p><strong>2. WebdriverIO</strong></p>
  <p><em>wdio.shared.conf.js</em></p>
  <pre><code>exports.config = {
      // ====================
      // Runner and framework
      // Configuration
      // ====================
      runner: 'local',
      framework: 'jasmine',
      jasmineNodeOpts: {
          // Updated the timeout to 30 seconds due to possible longer appium calls
          // When using XPATH
          defaultTimeoutInterval: 90000,
          helpers: [require.resolve('@babel/register')],
      },
      sync: true,
      logLevel: 'silent',
      deprecationWarnings: true,
      bail: 0,
      baseUrl: 'http://the-internet.herokuapp.com',
      waitforTimeout: 10000,
      connectionRetryTimeout: 90000,
      connectionRetryCount: 3,
      reporters: ['spec'],
  
      // ====================
      // Appium Configuration
      // ====================
      services: [
          [
              'appium',
              {
              // For options see
              // https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
                  args: {
                      // Auto download ChromeDriver
                      relaxedSecurity: true,
                      // chromedriverAutodownload: true,
                      // For more arguments see
                      // https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
                  },
                  command: 'appium',
              },
          ],
      ],
      port: 4723,
  };
  </code></pre>
  <p><em>wdio.android.app.conf.js</em>.</p>
  <pre><code>const { join } = require('path');
  const { config } = require('./wdio.shared.conf');
  
  // ============
  // Specs
  // ============
  config.specs = [
      './tests/specs/**/app*.spec.js',
  ];
  
  // ============
  // Capabilities
  // ============
  // For all capabilities please check
  // http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
  config.capabilities = [
      {
          // The defaults you need to have in your config
          platformName: 'Android',
          maxInstances: 1,
          // For W3C the appium capabilities need to have an extension prefix
          // http://appium.io/docs/en/writing-running-appium/caps/
          // This is `appium:` for all Appium Capabilities which can be found here
          'appium:udid': 'emulator-5554',
          'appium:deviceName': 'Android SDK build for x86_64',
          'appium:platformVersion': '10.0',
          'appium:orientation': 'PORTRAIT',
          // `automationName` will be mandatory, see
          // https://github.com/appium/appium/releases/tag/v1.13.0
          'appium:automationName': 'Appium',
          // The path to the app
          'appium:app': join(process.cwd(), './apps/Android-NativeDemoApp-0.2.1.apk'),
          // Read the reset strategies very well, they differ per platform, see
          // http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
          'appium:noReset': true,
          'appium:newCommandTimeout': 240,
      },
  ];
  
  exports.config = config;
  </code></pre>
  <p><strong>3. Steps</strong></p>
  <p>First I open Android emulator and start the Appium server:</p>
  <p><a href="https://i.stack.imgur.com/c95bz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/c95bz.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/I68RJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/I68RJ.png" alt="enter image description here" /></a></p>
  <p>Then I use the command to run the tests <code>npm run android.app</code>. After that, the test cases are executed in the background, but <strong>nothing happens in the emulator</strong> and in the terminal I see the message <code>[HTTP] No route found for /session</code></p>
  <p><a href="https://i.stack.imgur.com/qM4B1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qM4B1.png" alt="enter image description here" /></a></p>
  <p><strong>My question is:</strong> what do need to pay attention to in order to fix this? Because I don't know what to look at and how to set up the configuration correctly. Thank you!</p>