List of usage examples for org.openqa.selenium By tagName
public static By tagName(String tagName)
From source file:com.mroza.seleniumTests.MrozaViewPage.java
License:Open Source License
protected void clickButtonIn(String buttonName, WebElement parentElement) { for (WebElement button : parentElement.findElements(By.tagName("button"))) { if (button.findElement(By.tagName("span")).getText().equals(buttonName)) { button.click();//from w ww . j a v a 2 s .c o m SeleniumWaiter.waitForJQueryAndPrimeFaces(driver); break; } } }
From source file:com.mroza.seleniumTests.MrozaViewPage.java
License:Open Source License
protected void clickDialogButton(String buttonName) { WebElement dialog = getVisibleDialogBox(); WebElement buttonPanel = dialog.findElement(By.className("ui-dialog-buttonpane")); List<WebElement> buttons = buttonPanel.findElements(By.tagName("button")); for (WebElement button : buttons) { List<WebElement> spanElements = button.findElements(By.tagName("span")); if (spanElements.get(1).getText().equals(buttonName)) { Actions actions = new Actions(driver); actions.moveToElement(button).click().perform(); SeleniumWaiter.waitForJQueryAndPrimeFaces(driver); break; }/* www.j a va 2 s .co m*/ } }
From source file:com.mroza.seleniumTests.NewKidsViewTests.NewKidsViewPage.java
License:Open Source License
public void setKidCode(String code) { WebElement table = driver.findElement(By.tagName("table")); List<WebElement> columns = table.findElements(By.tagName("tr")).get(0).findElements(By.tagName("td")); WebElement searchBoxInput = columns.get(1).findElement(By.tagName("input")); searchBoxInput.sendKeys(code);/* w ww . jav a2 s. co m*/ }
From source file:com.mroza.seleniumTests.NewProgramsViewTests.NewProgramsViewPage.java
License:Open Source License
private WebElement getInputFieldNamed(String inputName) { WebElement tableWithInputFields = driver.findElement(By.tagName("table")); WebElement tableBody = tableWithInputFields.findElement(By.tagName("tbody")); List<WebElement> inputRows = tableBody.findElements(By.tagName("tr")); for (WebElement inputRow : inputRows) { if (inputRow.findElements(By.tagName("td")).get(0).getText().equals(inputName)) { return inputRow.findElements(By.tagName("td")).get(1).findElement(By.tagName("input")); }/* w w w .j a v a2 s.com*/ } return null; }
From source file:com.mroza.seleniumTests.NewProgramsViewTests.NewProgramsViewPage.java
License:Open Source License
private WebElement getTextAreaNamed(String inputName) { WebElement tableWithInputFields = driver.findElement(By.tagName("table")); WebElement tableBody = tableWithInputFields.findElement(By.tagName("tbody")); List<WebElement> inputRows = tableBody.findElements(By.tagName("tr")); for (WebElement inputRow : inputRows) { if (inputRow.findElements(By.tagName("td")).get(0).getText().equals(inputName)) { return inputRow.findElements(By.tagName("td")).get(1).findElement(By.tagName("textArea")); }/* w ww. j a v a 2 s .c o m*/ } return null; }
From source file:com.mroza.seleniumTests.ProgramDirectoryViewTests.ProgramDirectoryViewPage.java
License:Open Source License
public List<String> getAllProgramsSymbols() { List<WebElement> tableRows = getTableRows(); List<String> programSymbolsList = new ArrayList<>(); for (WebElement tableRow : tableRows) { List<WebElement> symbolsElement = tableRow.findElements(By.tagName("td")); WebElement symbolElement = symbolsElement.get(0); String programSymbol = symbolElement.getText(); programSymbolsList.add(programSymbol); }/*from w ww . j a va 2 s. co m*/ return programSymbolsList; }
From source file:com.mroza.seleniumTests.ProgramDirectoryViewTests.ProgramDirectoryViewPage.java
License:Open Source License
public void setSearchValue(String expectedSearchedSymbol) { WebElement searchBoxInput = driver.findElement(By.className("ui-outputpanel")); searchBoxInput.findElement(By.tagName("input")).sendKeys(expectedSearchedSymbol); SeleniumWaiter.waitForJQueryAndPrimeFaces(driver); }
From source file:com.mroza.seleniumTests.ProgramDirectoryViewTests.ProgramDirectoryViewPage.java
License:Open Source License
public void clickDeleteProgramButtonForProgramWithSymbol(String programSymbol) { List<WebElement> tableRows = getTableRows(); for (WebElement tableRow : tableRows) { List<WebElement> columns = tableRow.findElements(By.tagName("td")); if (columns.get(0).getText().equals(programSymbol)) { WebElement deleteButton = columns.get(3).findElement(By.tagName("button")); deleteButton.click();/*from ww w .j a v a 2 s . co m*/ } } }
From source file:com.mroza.seleniumTests.ProgramDirectoryViewTests.ProgramDirectoryViewPage.java
License:Open Source License
private List<WebElement> getTableRows() { WebElement tableContent = driver.findElement(By.tagName("table")); WebElement tableBody = tableContent.findElement(By.tagName("tbody")); return tableBody.findElements(By.tagName("tr")); }
From source file:com.mto.arquillian.demo.ChromeWebDriverTest.java
License:Open Source License
@Test @RunAsClient//from w w w.ja v a2 s .c o m @InSequence(0) public void testAccessRegisterForm(@ArquillianResource URL url) throws Exception { driver.navigate().to(url.toString() + "register/"); WebElement form = driver.findElement(By.tagName("form")); assertNotNull(form); }