### Question:
WebBase extends MappedElement implements BaseUI { public List<WebElement> getElements() { try { List<WebElement> elements = new ArrayList<WebElement>(); for (String locator : getElementMap().locator()) { locator = getLocatorWithParameters(locator); By by = ByConverter.convert(getElementMap().locatorType(), locator); getDriver().manage().timeouts().implicitlyWait(getImplicitlyWaitTimeoutInMilliseconds(), TimeUnit.MILLISECONDS); try { List<WebElement> elementsFound = getDriver().findElements(by); if (elementsFound.size() > 0) { elements.addAll(elementsFound); } else { elements = getElementsWithFrames(getDriver(), by); } } catch (Throwable t) { elements = getElementsWithFrames(getDriver(), by); } finally { getDriver().manage().timeouts().implicitlyWait(BehaveConfig.getRunner_ScreenMaxWait(), TimeUnit.MILLISECONDS); } } return elements; } catch (BehaveException be) { throw be; } catch (Exception e) { throw new BehaveException(message.getString("exception-unexpected", e.getMessage()), e); } }  WebDriver getDriver(); void logStatistics(String msg); List<WebElement> getElements(); String getText(); void waitElement(Integer index); void waitElementOnlyVisible(Integer index); @SuppressWarnings("unchecked") void waitLoading(); void isVisibleDisabled(); void waitVisibleClickableEnabled(); Long getImplicitlyWaitTimeoutInMilliseconds(); List<String> getLocatorParameter(); void setLocatorParameters(List<String> locatorParameter2); JavascriptExecutor getJavascriptExecutor(); String getId(); void waitVisibleText(String text); void waitNotVisibleText(String text); void waitVisibleOrNotTextInElement(String text, boolean visible); void waitInvisible(); void waitInvisible(int index); void blur(); void waitText(String text); void waitNotText(String text); void waitTextNotInElement(String text); void waitTextInElement(String text); static ElementMap loadingMap; static boolean alreadySearchLoadingMap; }### Answer:
@Test @Ignore public void testGetElements() { WebDriver driver = Mockito.mock(WebDriver.class); Runner runner = Mockito.mock(Runner.class); Mockito.when(runner.getDriver()).thenReturn(driver); WebBase webBase = new WebBase(); ElementMap mapa = Mockito.mock(ElementMap.class); Mockito.when(mapa.locator()).thenReturn(new String[] { "ID" }); Mockito.when(mapa.locatorType()).thenReturn(ElementLocatorType.XPath); webBase.setElementMap(mapa); webBase.setRunner(runner); List<WebElement> lista = webBase.getElements(); assertTrue(lista.size() > 0); }