title: How to select different dropdowns which has same name in selenium webdriver
body: <p><a href="https://i.stack.imgur.com/FrlSL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FrlSL.png" alt="This select fields has same name"></a></p>
  
  <p>Error showing as</p>
  
  <pre><code>org.openqa.selenium.remote.RemoteWebElement cannot be cast to org.openqa.selenium.support.ui.Select
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>List&lt;WebElement&gt; ref = driver.findElements(By.name("customerBean.relationCd"));
  System.out.println("reference dropdowns " + ref.size());
  ((Select) ref.get(0)).selectByIndex(18);
  ((Select) ref.get(1)).selectByIndex(18);
  </code></pre>