Package org.openqa.selenium

Examples of org.openqa.selenium.By


    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_unpublish']", row + 2, 5));
    clickAndConfirm(link);
  }

  public static void clickAndConfirmEvaluationRemind(int row) {
    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_remind']", row + 2, 5));
    clickAndConfirm(link);
  }
View Full Code Here


    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_remind']", row + 2, 5));
    clickAndConfirm(link);
  }

  public static void clickAndConfirmEvaluationDelete(int row) {
    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_delete']", row + 2, 5));
    clickAndConfirm(link);
  }
View Full Code Here

    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_delete']", row + 2, 5));
    clickAndConfirm(link);
  }

  public static void clickAndCancelEvaluationDelete(int row) {
    By link = By.xpath(String.format("//div[@id='coordinatorEvaluationTable']//table[@id='dataform']//tr[%d]//td[%d]//a[@class='t_eval_delete']", row + 2, 5));
    waitAndClickAndCancel(link);
  }
View Full Code Here

    WebElement dataform = driver.findElement(By.id("dataform"));

    while (dataform.findElements(By.tagName("tr")).size() > 1) {
      System.out.println("Delete a student...");

      By by = By.xpath(String
          .format("//table[@id='dataform']//tr[%d]//a[4]", 2));
      waitForElementPresent(by);
      clickAndConfirm(by);

      waitForElementPresent(By.id("dataform tr"));
View Full Code Here

          // attesa
          waitingRandomSec(5);

          // selezione origine
          By originElement = By
              .id("ControlGroupRibbonAnonHomeView_AvailabilitySearchInputRibbonAnonHomeView_AutocompleteOriginStation");
          driver.findElement(originElement).clear();
          driver.findElement(originElement).click();
          waitingRandomSec(2);
          driver.findElement(originElement).sendKeys(trip.getOrigin());
          driver.findElement(By.xpath("html/body/div[8]/div/ul/li")).click();

          // selezione destinazione
          By destElement = By
              .id("ControlGroupRibbonAnonHomeView_AvailabilitySearchInputRibbonAnonHomeView_AutocompleteDestinationStation");
          driver.findElement(destElement).clear();
          driver.findElement(destElement).click();
          waitingRandomSec(2);
          driver.findElement(destElement).sendKeys(trip.getDestination());
View Full Code Here

                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                    } else {
                        localSearchContext = searchContext;
                    }
                    final By rootBy = FindByUtilities.getCorrectBy(field, configuration.get().getDefaultElementLocatingStrategy());
                    Object wrapper;
                    try {
                        wrapper = createWrapper(grapheneContext, field.getType(), WebElementUtils.findElementLazily(rootBy, localSearchContext));
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't instantiate element wrapper " + target.getClass() + "." + field.getName() + " of type " + field.getType(), e);
                    }
                    try {
                        setValue(field, target, wrapper);
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't set a value to the " + target.getClass() + "." + field.getName() + ".", e);
                    }
                } else if (field.getType().isAssignableFrom(List.class)
                        && isValidClass(getListType(field))) {
                    final SearchContext localSearchContext;
                    GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext).getContext();
                    if (grapheneContext == null) {
                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                    } else {
                        localSearchContext = searchContext;
                    }
                    final By rootBy = FindByUtilities.getCorrectBy(field, configuration.get().getDefaultElementLocatingStrategy());
                    try {
                        Class<?> type = getListType(field);
                        Object wrappers = createWrappers(grapheneContext, type, WebElementUtils.findElementsLazily(rootBy, localSearchContext));
                        setValue(field, target, wrappers);
                    } catch (Exception e) {
View Full Code Here

    driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
    String name = "Buttons, Various uses of UIButton2";

    // single
    driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
    By b = By.xpath("//*[@name='" + name + "']");
    long start = System.currentTimeMillis();
    try {
      driver.findElement(b);
      Assert.fail("shouldn't find element" + name);
    } catch (NoSuchElementException e) {
View Full Code Here

    element.tap();
  }

  @Test
  public void cannotInteractIfActionSheet() throws Exception {
    By b = By.xpath(actionOk);
    WebElement el = driver.findElement(b);
    el.click();

    try {
      el.getAttribute("name");
View Full Code Here

    alert.dismiss();
  }

  @Test
  public void okCancel() throws Exception {
    By b = By.xpath(actionOKCancel);
    WebElement el = driver.findElement(b);
    el.click();

    Alert alert = driver.switchTo().alert();
    alert.dismiss();
View Full Code Here

    }
  }

  @Test
  public void findWhenAlertAreGone() throws Exception {
    By b = By.xpath(actionOKCancel);
    WebElement el = driver.findElement(b);
    el.click();

    Alert alert = driver.switchTo().alert();
    try {
View Full Code Here

TOP

Related Classes of org.openqa.selenium.By

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.