Package org.openqa.selenium

Examples of org.openqa.selenium.By


        List<?> pageFragments = createPageFragmentList(getListType(field), searchContext, rootBy);
        setValue(field, target, pageFragments);
    }

    protected final void setupPageFragment(SearchContext searchContext, Object target, Field field) {
        By rootBy = FindByUtilities.getCorrectBy(field);
        if (rootBy == null) {
            throw new PageFragmentInitializationException("Your declaration of Page Fragment in test "
                + field.getDeclaringClass().getName() + " is annotated with @FindBy without any "
                + "parameters, in other words without reference to root of the particular Page Fragment on the page!"
                + NEW_LINE);
View Full Code Here


    @Override
    public void enrich(SearchContext searchContext, Object target) {
        try {
            List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
            for (Field field : fields) {
                By by = FindByUtilities.getCorrectBy(field);
                String message = "Your @FindBy annotation over field " + NEW_LINE + field.getClass() + NEW_LINE
                    + " declared in: " + NEW_LINE + field.getDeclaringClass().getName() + NEW_LINE
                    + " is annotated with empty @FindBy annotation, in other words it "
                    + "should contain parameter which will define the strategy for referencing that element.";
                // WebElement
View Full Code Here

    assertTrue("Expected Opera to run", driver.isRunning());
    driver.navigate().to(pages.oex);

    try {
      // The dummy extension sets a HTML attribute on the <html> element.
      By by = By.cssSelector("html[isoexinstalled759='yes']");
      (new WebDriverWait(driver, 2)).until(ExpectedConditions.presenceOfElementLocated(by));
    } catch (TimeoutException e) {
      fail("Custom opera extension not detected!");
    }
View Full Code Here

    super(new DefaultElementLocatorFactory(searchContext));
  }

  @Override
  public Object decorate(ClassLoader loader, Field field) {
    By selector = new Annotations(field).buildBy();
    if (SelenideElement.class.isAssignableFrom(field.getType())) {
      return ElementLocatorProxy.wrap(selector, factory.createLocator(field));
    } else if (ElementsContainer.class.isAssignableFrom(field.getType())) {
      return createElementsContainer(selector, field);
    } else if (isDecoratableList(field, ElementsContainer.class)) {
View Full Code Here

    }

   
    private void setObjectContext(Locator objectContextLocator) {
        if (objectContextLocator != null) {
            By by = by(objectContextLocator);
            if (by == null) {
                throw new RuntimeException("Cannot convert locator: " + objectContextLocator.getLocatorType() + " " + objectContextLocator.getLocatorValue());
            }
           
            int index = objectContextLocator.getIndex();
View Full Code Here

    private PageElement getWebPageElement(String objectName, Locator objectLocator, int index) {
        List<PageElement> pageElements = cachedElementsList.get(objectName);
       
        if (pageElements == null) {
            By by = by(objectLocator);
            if (by == null) {
                return null;
            }
           
            List<WebElement> webElements = driverFindElements(by);
View Full Code Here

        }
    }

    private PageElement locatorToElement(String objectName, Locator objectLocator) {
        PageElement pageElement;
        By by = by(objectLocator);
        if (by == null) {
            return null;
        }
       
        try {
View Full Code Here

    verifyMainPage();
  }

  // -----------------------------UI Actions ----------------------------->> Student:
  public static void studentClickEvaluationViewResults(int row) {
    By link = By.xpath(String.format("//div[@id='studentPastEvaluations']//table[@id='dataform']//tr[%d]//td[%d]//a[1]", row + 2, 5));
    waitAndClick(link);
  }
View Full Code Here

  public static void clickCourseDetailView(int row) {
    waitAndClick(By.xpath(String.format("//table[@id='dataform']//tr[%d]//a[1]", row + 2)));
  }

  public static void clickCourseDetailEdit(int row) {
    By link = By.xpath(String.format("//table[@id='dataform']//tr[%d]//a[2]", row + 2));
    waitAndClick(link);
  }
View Full Code Here

    By link = By.xpath(String.format("//table[@id='dataform']//tr[%d]//a[2]", row + 2));
    waitAndClick(link);
  }

  public static void clickCourseDetailInvite(int row) {
    By link = By.xpath(String.format("//div[@id='coordinatorStudentTable']//table[@id='dataform']//tr[%d]//td[%d]//a[3]", row + 2, 4));
    waitAndClick(link);
  }
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.