2 place in the page with the same xpath : I want to insert a text to a filed. This filed xpath = "//*[@id='email']".
This xpath is moved to 2 places in the web page. The first is not visible and the second is ok. I want to insert text to the second. I do it like this:

        String xpathOfElement = "//*[@id='email']";

		List<WebElement> a = driver.findElements(By.xpath(xpathOfElement));
		a.get(1).sendKeys("hhh");
I received this error msg:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

