@Test
public void throwsExceptionIfNoSuitableElementsAreFound() {

    WebElement incorrectWebElement = mock(WebElement.class);
    when(incorrectWebElement.getText()).thenReturn("sometATPhing");
    when(incorrectWebElement.isDisplayed()).thenReturn(true);
    List<WebElement> webElements = new ArrayList<>();
    webElements.add(incorrectWebElement);
    By elementsLocator = By.className(initialCollectorClass);
    WebDriver webDriver = mock(WebDriver.class);
    when(webDriver.findElements(elementsLocator)).thenReturn(webElements);
    SearchContextFunction contextProvider = webDriver1 -> webDriver;
    ClickClassByText clickClassByText = new ClickClassByText(initialCollectorClass, text, expectsHttp, contextProvider);
    thrown.expect(ElementNotSelectableException.class);
    clickClassByText.executeAfterJSPreconditionHasBeenSatisfied(webDriver, mock(ReplayingState.class), contextProvider);
}