@Test public void itShouldClickOnTheFirstClickableElement() { final WebElement button1 = mock(WebElement.class); given(button1.getText()).willReturn(TEXT); final WebElement button2 = mock(WebElement.class); given(button1.getText()).willReturn(TEXT); final List<WebElement> elements = new ArrayList<>(); elements.add(button1); elements.add(button2); given(button1.isDisplayed()).willReturn(false); given(button2.getText()).willReturn(TEXT); given(button2.isDisplayed()).willReturn(true); given(button2.isEnabled()).willReturn(true); given(container.findElements(By.tagName(TAG_NAME))).willReturn(elements); final ExecuteResult result = action.executeAction(connectors); assertTrue(result.isSuccess()); verify(button1, never()).click(); verify(button2).click(); }
public String getText() { return text; }
ClickElementByTextAction extends WebSymbolAction { public String getText() { return text; } }
ClickElementByTextAction extends WebSymbolAction { public String getText() { return text; } ClickElementByTextAction(); }
ClickElementByTextAction extends WebSymbolAction { public String getText() { return text; } ClickElementByTextAction(); WebElementLocator getNode(); void setNode(WebElementLocator node); String getTagName(); void setTagName(String tagName); String getText(); void setText(String text); }
ClickElementByTextAction extends WebSymbolAction { public String getText() { return text; } ClickElementByTextAction(); WebElementLocator getNode(); void setNode(WebElementLocator node); String getTagName(); void setTagName(String tagName); String getText(); void setText(String text);  }