@Test public void testIndex() { ElementLocator locator = mock(ElementLocator.class); when(locator.findElements()).thenReturn(Arrays.asList(element1, element2, element3)); List<WebElement> webElementList = LocatorProxies.createWebElementList(locator); WebElement atIndex = LocatorProxies.index(webElementList, 1); assertThat(LocatorProxies.loaded(atIndex)).isFalse(); assertThat(atIndex).isEqualTo(element2); }