List of usage examples for org.openqa.selenium By partialLinkText
public static By partialLinkText(String partialLinkText)
From source file:org.glowroot.tests.webdriver.BasicSmokeTest.java
License:Apache License
@Test public void shouldCheckTransactionPages() throws Exception { // given/*from w w w . ja va 2s .c o m*/ App app = new App(driver, "http://localhost:" + container.getUiPort()); GlobalNavbar globalNavbar = new GlobalNavbar(driver); app.open(); // hitting F5 is just to test 304 responses Utils.withWait(driver, By.partialLinkText("Metrics")).sendKeys(Keys.F5); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][contains(., '%')]")); driver.findElement(By.xpath("//button[@title='By percent of total time']")).click(); driver.findElement(By.linkText("By average time")).click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][contains(., 'ms')]")); driver.findElement(By.xpath("//button[@title='By average time']")).click(); driver.findElement(By.linkText("By throughput (per min)")).click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][contains(., '/min')]")); driver.findElement(By.xpath("//button[@title='By throughput (per min)']")).click(); driver.findElement(By.linkText("By percent of total time")).click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][contains(., '%')]")); Utils.withWait(driver, By.partialLinkText("Metrics")).click(); Utils.withWait(driver, By.partialLinkText("Traces")).click(); Utils.withWait(driver, By.partialLinkText("Profile")).click(); Utils.withWait(driver, By.linkText("View flame graph (experimental)")).click(); // give flame graph a chance to render (only for visual when running locally) Thread.sleep(500); globalNavbar.getTransactionsLink().click(); Utils.withWait(driver, By.partialLinkText("/jdbcservlet")).click(); Utils.withWait(driver, By.partialLinkText("Metrics")).click(); Utils.withWait(driver, By.partialLinkText("Traces")).click(); Utils.withWait(driver, By.partialLinkText("Profile")).click(); Utils.withWait(driver, By.linkText("View flame graph (experimental)")).click(); }
From source file:org.glowroot.tests.webdriver.BasicSmokeTest.java
License:Apache License
@Test public void shouldCheckErrorsPages() throws Exception { // given//w w w . ja v a2 s . c o m App app = new App(driver, "http://localhost:" + container.getUiPort()); GlobalNavbar globalNavbar = new GlobalNavbar(driver); app.open(); globalNavbar.getErrorsLink().click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][not(contains(., '%'))]")); driver.findElement(By.xpath("//button[@title='By error count']")).click(); driver.findElement(By.linkText("By error rate")).click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][contains(., '%')]")); driver.findElement(By.xpath("//button[@title='By error rate']")).click(); driver.findElement(By.linkText("By error count")).click(); Utils.withWait(driver, By.xpath("//a[@gt-display='All Transactions'][not(contains(., '%'))]")); Utils.withWait(driver, By.xpath("//input[@ng-model='errorFilter']")).sendKeys("xyz"); Utils.withWait(driver, By.xpath("//button[@ng-click='refreshButtonClick()']")).click(); Utils.withWait(driver, By.partialLinkText("Traces")).click(); globalNavbar.getErrorsLink().click(); Utils.withWait(driver, By.partialLinkText("/errorservlet")).click(); Utils.withWait(driver, By.partialLinkText("Traces")).click(); }
From source file:org.glowroot.tests.webdriver.NoTracesNoProfilesSmokeTest.java
License:Apache License
@Test public void shouldCheckTransactionPages() throws Exception { // given/* w ww . ja v a2 s. com*/ App app = new App(driver, "http://localhost:" + container.getUiPort()); GlobalNavbar globalNavbar = new GlobalNavbar(driver); app.open(); Utils.withWait(driver, By.linkText("Traces (0)")); Utils.withWait(driver, By.partialLinkText("/jdbcservlet")).click(); // give time for page to load and tab bar to refresh Thread.sleep(1000); globalNavbar.getErrorsLink().click(); Utils.withWait(driver, By.xpath("//a[@href='error/traces'][contains(., 'Traces (0)')]")); globalNavbar.getJvmLink().click(); // todo wait }
From source file:org.jboss.arquillian.graphene.enricher.Factory.java
License:Open Source License
public static By getReferencedBy(FindBy findByAnnotation) { String value = null;// ww w .j a v a 2 s. c o m value = findByAnnotation.className().trim(); if (!value.isEmpty()) { return By.className(value); } value = findByAnnotation.css().trim(); if (!value.isEmpty()) { return By.cssSelector(value); } value = findByAnnotation.id().trim(); if (!value.isEmpty()) { return By.id(value); } value = findByAnnotation.xpath().trim(); if (!value.isEmpty()) { return By.xpath(value); } value = findByAnnotation.name().trim(); if (!value.isEmpty()) { return By.name(value); } value = findByAnnotation.tagName().trim(); if (!value.isEmpty()) { return By.tagName(value); } value = findByAnnotation.linkText().trim(); if (!value.isEmpty()) { return By.linkText(value); } value = findByAnnotation.partialLinkText().trim(); if (!value.isEmpty()) { return By.partialLinkText(value); } return null; }
From source file:org.jboss.arquillian.graphene.enricher.findby.Annotations.java
License:Apache License
protected By buildByFromLongFindBy(FindBy findBy) { How how = findBy.how();// ww w. ja v a2s. c o m String using = findBy.using(); switch (how) { case CLASS_NAME: return By.className(using); case CSS: return By.cssSelector(using); case ID: return By.id(using); case ID_OR_NAME: return new ByIdOrName(using); case LINK_TEXT: return By.linkText(using); case NAME: return By.name(using); case PARTIAL_LINK_TEXT: return By.partialLinkText(using); case TAG_NAME: return By.tagName(using); case XPATH: return By.xpath(using); default: // Note that this shouldn't happen (eg, the above matches all // possible values for the How enum) throw new IllegalArgumentException("Cannot determine how to locate element " + field); } }
From source file:org.jboss.arquillian.graphene.enricher.findby.Annotations.java
License:Apache License
private By getByFromGrapheneHow(org.jboss.arquillian.graphene.enricher.findby.How how, String using) { switch (how) { case CLASS_NAME: return By.className(using); case CSS: return By.cssSelector(using); case ID:/* ww w. j av a2s . c om*/ return By.id(using); case ID_OR_NAME: return new ByIdOrName(using); case LINK_TEXT: return By.linkText(using); case NAME: return By.name(using); case PARTIAL_LINK_TEXT: return By.partialLinkText(using); case TAG_NAME: return By.tagName(using); case XPATH: return By.xpath(using); case JQUERY: return ByJQuery.jquerySelector(using); default: // Note that this shouldn't happen (eg, the above matches all // possible values for the How enum) throw new IllegalArgumentException("Cannot determine how to locate element " + field); } }
From source file:org.jboss.arquillian.graphene.enricher.findby.Annotations.java
License:Apache License
protected By buildByFromShortFindBy(FindBy findBy) { if (!"".equals(findBy.className())) return By.className(findBy.className()); if (!"".equals(findBy.css())) return By.cssSelector(findBy.css()); if (!"".equals(findBy.id())) return By.id(findBy.id()); if (!"".equals(findBy.linkText())) return By.linkText(findBy.linkText()); if (!"".equals(findBy.name())) return By.name(findBy.name()); if (!"".equals(findBy.partialLinkText())) return By.partialLinkText(findBy.partialLinkText()); if (!"".equals(findBy.tagName())) return By.tagName(findBy.tagName()); if (!"".equals(findBy.xpath())) return By.xpath(findBy.xpath()); // Fall through return null;/*from w w w. j a va2s .c om*/ }
From source file:org.jboss.arquillian.graphene.enricher.findby.Annotations.java
License:Apache License
protected By buildByFromShortFindBy(org.jboss.arquillian.graphene.enricher.findby.FindBy findBy) { if (!"".equals(findBy.className())) return By.className(findBy.className()); if (!"".equals(findBy.css())) return By.cssSelector(findBy.css()); if (!"".equals(findBy.id())) return By.id(findBy.id()); if (!"".equals(findBy.linkText())) return By.linkText(findBy.linkText()); if (!"".equals(findBy.name())) return By.name(findBy.name()); if (!"".equals(findBy.partialLinkText())) return By.partialLinkText(findBy.partialLinkText()); if (!"".equals(findBy.tagName())) return By.tagName(findBy.tagName()); if (!"".equals(findBy.xpath())) return By.xpath(findBy.xpath()); if (!"".equals(findBy.jquery())) return ByJQuery.jquerySelector((findBy.jquery())); // Fall through return null;// w ww. ja v a2 s. c o m }
From source file:org.jboss.arquillian.graphene.findby.Annotations.java
License:Open Source License
private By getByFromHow(How how, String using) { switch (how) { case CLASS_NAME: return By.className(using); case CSS: return By.cssSelector(using); case ID:/*w w w .j av a 2 s . co m*/ return By.id(using); case ID_OR_NAME: return new ByIdOrName(using); case LINK_TEXT: return By.linkText(using); case NAME: return By.name(using); case PARTIAL_LINK_TEXT: return By.partialLinkText(using); case TAG_NAME: return By.tagName(using); case XPATH: return By.xpath(using); default: // Note that this shouldn't happen (eg, the above matches all // possible values for the How enum) throw new IllegalArgumentException("Cannot determine how to locate element " + field); } }
From source file:org.jboss.arquillian.graphene.findby.Annotations.java
License:Open Source License
protected By buildByFromShortFindBy(FindBy findBy) { if (!"".equals(findBy.className())) { return By.className(findBy.className()); }/*from w w w.j av a 2s . c om*/ if (!"".equals(findBy.css())) { return By.cssSelector(findBy.css()); } if (!"".equals(findBy.id())) { return By.id(findBy.id()); } if (!"".equals(findBy.linkText())) { return By.linkText(findBy.linkText()); } if (!"".equals(findBy.name())) { return By.name(findBy.name()); } if (!"".equals(findBy.partialLinkText())) { return By.partialLinkText(findBy.partialLinkText()); } if (!"".equals(findBy.tagName())) { return By.tagName(findBy.tagName()); } if (!"".equals(findBy.xpath())) { return By.xpath(findBy.xpath()); } // Fall through return null; }