ClickLinkAction extends WebSymbolAction { public WebElementLocator getNode() { return node; } ClickLinkAction(); @Override ExecuteResult execute(WebSiteConnector connector); String getValue(); @Transient @JsonIgnore String getValueWithVariableValues(); void setValue(String value); WebElementLocator getNode(); void setNode(WebElementLocator node);  }
@Test public void shouldReturnFailedIfLinkCouldNotBeClicked() { WebElement body = mock(WebElement.class); given(webSiteConnector.getElement(action.getNode())).willReturn(body); when(body.findElement(By.linkText("Click Me"))).thenThrow(new NoSuchElementException("")); assertFalse(action.executeAction(connectors).isSuccess()); }