title: How to run one test on several devices with appium and Python
body: <p>I am trying Appium using Python language. And I have a simple script on Python for Android (just open app, find text and assert this text).
  I want to run this test on several devices.</p>
  <p><strong>What I already did:</strong></p>
  <p>I have created two Android emulators. Run Selenium Grid hub. Create two configuration files for each emulator and run 2 Appium servers:</p>
  <p>hub</p>
  <pre><code>java -jar selenium-server-standalone-2.53.0.jar -role webdriver -nodeConfig emulator-5554.json -hub http://127.0.0.1:4444/grid/register
  </code></pre>
  <p>Appium servers:</p>
  <pre><code>appium --address 127.0.0.1 --port 4721 -bp 2253 --udid emulator-5554 --nodeconfig C:\SeleniumGrid\Android\emulator-5554.json
  </code></pre>
  <p>and</p>
  <pre><code>appium --address 127.0.0.1 --port 4722 -bp 2254 --udid emulator-5556 --nodeconfig C:\SeleniumGrid\Android\emulator-5556.json
  </code></pre>
  <p>My JSON configuration files:</p>
  <p>first:</p>
  <pre><code>{  &quot;capabilities&quot;:
        [
          {
            &quot;deviceName&quot;: &quot;emulator-5554&quot;,
            &quot;browserName&quot;:&quot;Browser&quot;, 
            &quot;version&quot;:&quot;6.1&quot;,
            &quot;maxInstances&quot;: 1,
            &quot;platform&quot;:&quot;ANDROID&quot;
          }
        ],
    &quot;configuration&quot;:
    {
      &quot;cleanUpCycle&quot;:2000,
      &quot;timeout&quot;:30000,
      &quot;proxy&quot;: &quot;org.openqa.grid.selenium.proxy.DefaultRemoteProxy&quot;,
      &quot;url&quot;:&quot;http://127.0.0.1:4721/wd/hub&quot;,
      &quot;host&quot;: &quot;127.0.0.1&quot;,
      &quot;port&quot;: 4721,
      &quot;maxSession&quot;: 10,
      &quot;register&quot;: true,
      &quot;registerCycle&quot;: 5000,
      &quot;hubPort&quot;: 4444,
      &quot;hubHost&quot;: &quot;127.0.0.1&quot;
    }
  }
  </code></pre>
  <p>second:</p>
  <pre><code>{  &quot;capabilities&quot;:
        [
          {
            &quot;browserName&quot;:&quot;Browser&quot;,  
            &quot;deviceName&quot;: &quot;emulator-5556&quot;,
            &quot;version&quot;:&quot;4.4.4&quot;,
            &quot;maxInstances&quot;: 1,
            &quot;platform&quot;:&quot;ANDROID&quot;
          }
        ],
    &quot;configuration&quot;:
    {
      &quot;cleanUpCycle&quot;:2000,
      &quot;timeout&quot;:30000,
      &quot;proxy&quot;: &quot;org.openqa.grid.selenium.proxy.DefaultRemoteProxy&quot;,
      &quot;url&quot;:&quot;http://127.0.0.1:4722/wd/hub&quot;,
      &quot;host&quot;: &quot;127.0.0.1&quot;,
      &quot;port&quot;: 4722,
      &quot;maxSession&quot;: 10,
      &quot;register&quot;: true,
      &quot;registerCycle&quot;: 5000,
      &quot;hubPort&quot;: 4444,
      &quot;hubHost&quot;: &quot;127.0.0.1&quot;
    }
  }
  </code></pre>
  <p>And my setUp method:</p>
  <pre><code>def setUp(self):
          desired_caps = {}
          desired_caps['platformName'] = 'Android'
          desired_caps['platformVersion'] = 'platformVersion'
          desired_caps['deviceName'] = 'deviceName'
  
          desired_caps['app'] = 'oneDo.apk'
  
          self.driver = webdriver.Remote('http://127.0.0.1:4444/wd/hub', desired_caps)
  </code></pre>
  <p>How can I run this one test on several devices? Any ideas?</p>