List of usage examples for org.openqa.selenium By tagName
public static By tagName(String tagName)
From source file:com.perceptron.findjesus.WeightedBestFirstSearch.java
License:MIT License
private void getAllCurrentPageLinks(ArrayList<String> links) { // I'm only interested in links within the content WebElement content = browser.findElement(By.id("mw-content-text")); // I'm assuming for now that all links will be in <a> tags List<WebElement> tags = content.findElements(By.tagName("a")); for (WebElement current : tags) { String link = current.getAttribute("href"); if (link != null) { // We only accept links that keep us on wikipedia if (link.contains(baseURL)) { links.add(link);/*from w ww .ja v a 2 s . com*/ } } } tags.clear(); }
From source file:com.photon.phresco.Screens.BaseScreen.java
License:Apache License
public boolean isTextPresent(String text) { if (text != null) { boolean value = driver.findElement(By.tagName("body")).getText().contains(text); //System.out.println("--------TextCheck value---->"+text+"------------Result is-------------"+value); AssertJUnit.assertTrue(value);//from w w w. j av a 2 s . c o m return value; } else { throw new RuntimeException("---- Text not present----"); } }
From source file:com.photon.phresco.Screens.InvalidJarBase.java
public boolean waitForTextPresent(String text) throws InterruptedException, ScreenException { if (text != null) { for (int i = 0; i < 40; i++) { System.out.println("--for loop---"); if (driver.findElement(By.tagName("body")).getText().contains(text)) { break; } else { if (i == 39) { throw new RuntimeException("---- Time out for finding the Text----"); }//from w w w . j a v a 2 s.c om System.out.println("-------wating for 1"); Thread.sleep(1000); } } } else { throw new RuntimeException("---- Text not existed----"); } return true; }
From source file:com.photon.phresco.Screens.InvalidJarBase.java
public boolean isTextPresent(String text) { if (text != null) { boolean value = driver.findElement(By.tagName("body")).getText().contains(text); System.out/*from w w w .j a va2 s.c o m*/ .println("--------TextCheck value---->" + text + "------------Result is-------------" + value); Assert.assertTrue(value); return value; } else { throw new RuntimeException("---- Text not present----"); } }
From source file:com.pluribus.vcf.pagefactory.VcfSettingsPage.java
public void logintoPnc(String usrname, String pwd) { vcfSettingsIcon.click();/*from w w w . jav a 2 s . c o m*/ waitForElementVisibility(licenseTab, 1000); licenseTab.click(); try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } pncCloudbutton.click(); setValue(username, usrname); setValue(password, pwd); okButton.click(); waitForElementVisibility(driver.findElement(By.tagName("ng-transclude")), 1000); }
From source file:com.pluribus.vcf.pagefactory.VcfSettingsPage.java
public void activateLicense(String usrname, String pwd, LicenseTypes type) { logintoPnc(usrname, pwd);//from w w w . j a v a 2s . c o m List<WebElement> rows = new ArrayList(); rows = driver.findElement(By.tagName("ng-transclude")).findElements(By.tagName("div")); String rowTable = null; for (WebElement row : rows) { System.out.println("Row text" + row.getText()); if (row.getText().contains(type.toString())) { rowTable = row.getText(); row.findElement(By.cssSelector("button.btn.btn-xs.btn-primary.ng-scope")).click(); break; } } }
From source file:com.pluribus.vcf.pagefactory.VcfSettingsPage.java
public void removeLicense(LicenseTypes type) { vcfSettingsIcon.click();// ww w . java 2s . com waitForElementVisibility(licenseTab, 1000); licenseTab.click(); waitForElementVisibility(driver.findElement(By.tagName("ng-transclude")), 1000); List<WebElement> rows = new ArrayList(); rows = driver.findElement(By.tagName("ng-transclude")).findElements(By.tagName("div")); String rowTable = null; for (WebElement row : rows) { System.out.println("Row text" + row.getText()); if (row.getText().contains(type.toString())) { rowTable = row.getText(); row.findElement(By.cssSelector("span.icon-img-link.fa fa-trash-o.ng-scope")).click(); break; } } }
From source file:com.pramati.wavemaker.pages.Deployment.java
License:Open Source License
/** * Get Name of Deployment field//from ww w . j av a 2 s . c om * * @return */ public String getDeploymentName() { log.info( "In Deployment page, Get's the deployment name from setting window of deployment page from tag name " + DEPLOYMENT_INPUT); return getSettingWindowEle().findElement(By.id(DEPLOYMENT_EDITOR)).findElement(By.tagName(DEPLOYMENT_INPUT)) .getText(); }
From source file:com.pramati.wavemaker.pages.ProjectCreationPage.java
License:Open Source License
/** * Click on File Menu.// w w w . j a va 2 s . c om * * @param menuName */ public void clickMenuBar(String menuName, String subMenu) { List<WebElement> menuList = ProjectCreationPage().findElements(By.tagName("span")); for (WebElement mL : menuList) { if (mL.getText().equalsIgnoreCase(menuName)) { mL.click(); clickFileSubMenu(subMenu); } } }