title: Appium : unable to run script in multiple android device connected
body: <p>Created multiple instance of appium.
  from console i run :</p>
  
  <pre><code>node . -p 4722 -U Z*****K --chromedriver-port 9
  515 -bp 2251
  
  node . -p 4723 -U T*****K --chromedriver-port 9
  516 -bp 2252
  </code></pre>
  
  <p>Instances are created on both the devices but the URL opens only on the second device connected.Browser in the first device just stays open without the url being opened.</p>
  
  <p>Code :</p>
  
  <p>Specflow file :</p>
  
  <p><strong>Test.feature</strong></p>
  
  <pre><code>  Scenario: Check Home Page
          Given I am on home page
          Then My title should be 'whatever'
  </code></pre>
  
  <p><strong>Steps.cs</strong></p>
  
  <pre><code> [Given(@"I am on home page")]
              public void GivenIAmOnHofHomePage()
              {
                  var testappium = new TestAppium();
                  testappium.SetUp();
                  testappium.OpenHomePage();
              }
  </code></pre>
  
  <p><strong>TestAppium.cs</strong></p>
  
  <pre><code>using System;
  using OpenQA.Selenium;
  using OpenQA.Selenium.Appium;
  using OpenQA.Selenium.Appium.Interfaces;
  using OpenQA.Selenium.Appium.MultiTouch;
  using OpenQA.Selenium.Interactions;
  using OpenQA.Selenium.Remote;
  using OpenQA.Selenium.Appium.Android;
  using OpenQA.Selenium.Appium.iOS;
  using Microsoft.VisualStudio.TestTools.UnitTesting;
  using TechTalk.SpecFlow;
  
  
  namespace Mobile.Tests.UIAutomation
  {
  
      public class TestAppium
      {
          public static IWebDriver driver=null;
  
          public void SetUp()
          {
              DesiredCapabilities capabilities = new DesiredCapabilities();
  
              capabilities.SetCapability("device", "Android");
              capabilities.SetCapability("browserName", "chrome");
              capabilities.SetCapability("deviceName", "test");
              capabilities.SetCapability("platformName", "Android");
              capabilities.SetCapability("platformVersion", "5.0.1");
              capabilities.SetCapability("udid", EnvironmentVariables.nexus);
  
              driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4722/wd/hub"), capabilities, TimeSpan.FromSeconds(180));
  
              DesiredCapabilities capabilitiess = new DesiredCapabilities();
  
              capabilitiess.SetCapability("device", "Android");
              capabilitiess.SetCapability("browserName", "chrome");
              capabilitiess.SetCapability("deviceName", "Arpan Buch");
              capabilitiess.SetCapability("platformName", "Android");
              capabilitiess.SetCapability("platformVersion", "5.0.2");
              capabilitiess.SetCapability("udid", EnvironmentVariables.motog);
  
              driver = new RemoteWebDriver(new  Uri("http://127.0.0.1:4723/wd/hub"), capabilitiess, TimeSpan.FromSeconds(180));
         }
  
         public void OpenHomePage()
          {
              driver.Navigate().GoToUrl("http://www.google.com");
  
              Console.WriteLine("Page title is : " +driver.Title);
              Assert.IsTrue(driver.Title.Equals("Google")," Sorry , the website didnt open!!");
          }
       }
    }
  </code></pre>
  
  <p>Instances are created on both the devices but the URL opens only on the second device connected. Browser in the first device just stays open without the url being opened.  </p>
  
  <p>Is the driver instance of the first device being overwritten (?). here is my programming limitation of being a tester and not a developer. Please Help!
  Thanks in advance!</p>