Package org.openqa.selenium

Examples of org.openqa.selenium.NoSuchElementException


    } while (true);

    if (id != null) {
      return elements;
    } else {
      throw new NoSuchElementException("Cannot find element(s) with " + type);
    }
  }
View Full Code Here


        throw new StaleElementReferenceException("This element is no longer part of DOM");
      }

      return new OperaWebElement(this, id);
    } else {
      throw new NoSuchElementException("Cannot find element(s) with " + type);
    }
  }
View Full Code Here

  }

  @Override
  protected WebElement getDelegate() {
    long startTime = System.currentTimeMillis();
    NoSuchElementException exception;
    do {
      try {
        return elementLocator.findElement();
      } catch (NoSuchElementException e) {
        exception = e;
View Full Code Here

        List<WebElement> toolTipLines = toolTip.findElements(By.cssSelector("text tspan"));
        for (WebElement toolTipLine : toolTipLines) {
            lines.add(toolTipLine.getText());
        }
        if (lineNo > lines.size()) {
            throw new NoSuchElementException("There is no line " + lineNo + "! There are only " + lines.size() + " lines in the tool tip");
        }
        //We return line - 1 because the lines Array starts a 0 not 1
        return lines.get(lineNo - 1);
    }
View Full Code Here

        LocatorHandler handler = handlerMap.get(ploc.type);
        if (handler == null)
            throw new UnsupportedOperationException("Unknown locator type: " + ploc);
        List<WebElement> elements = findElementsByLocator(handler, driver, ploc, selectedFrameLocators);
        if (elements == null)
            throw new SeleniumException("Element " + ploc + " not found", new NoSuchElementException(ploc.toString()));
        return filterElementsByOptionLocator(elements, ploc.option);
    }
View Full Code Here

  }

  @Override
  protected WebElement getDelegate() {
    long startTime = System.currentTimeMillis();
    NoSuchElementException exception;
    do {
      try {
        return elementLocator.findElement();
      } catch (NoSuchElementException e) {
        exception = e;
View Full Code Here

                List<TableRow> tableRows = WebElementUtil
                        .getTableRows(getDriver(),
                                waitForWebElement(personTable));
                if (tableRows.isEmpty()) {
                    log.debug("waiting for search result refresh...");
                    throw new NoSuchElementException("");
                }
                if (!tableRows.get(0).getCellContents()
                        .get(SEARCH_RESULT_PERSON_COLUMN).contains(personName)) {
                    throw new NoSuchElementException("User not in pos 0");
                }
                return tableRows;
            }
        }).get(0);
    }
View Full Code Here

    switch (errorCode) {
    case SUCCESS:
      break; // Nothing to do
    
    case 7:
      throw new NoSuchElementException(message);
     
    case 8:
      throw new NoSuchFrameException(message);
          
    case 9:
      throw new UnsupportedOperationException("You may not perform the requested action");
     
    case 10:
      throw new StaleElementReferenceException(
          String.format("You may not %s this element. It looks as if the reference is stale. " +
                        "Did you navigate away from the page with this element on?", message));

    case 11:
      throw new ElementNotVisibleException(
          String.format("You may not %s an element that is not displayed", message));
     
    case 12:
      throw new UnsupportedOperationException(
              String.format("You may not %s an element that is not enabled", message));

    case 14:
      throw new WebDriverException("An unhandled exception has occured. " + message);

    case 15:
      throw new UnsupportedOperationException(
              String.format("The element appears to be unselectable: %s", message));

    case 16:
      throw new NoSuchElementException(message + " (no document found)");

    case 17:
      throw new UnexpectedJavascriptExecutionException(message);

    case 21:
View Full Code Here

    try {
      handleErrorCode("xpath", using, result);
    } catch (UnexpectedJavascriptExecutionException e) {
      // Looks like the page was reloading. Fine. We didn't find the element
      throw new NoSuchElementException("Unable to find element by xpath: " + using);
    }

    return new InternetExplorerElement(lib, parent, rawElement.getValue());
  }
View Full Code Here

    try {
      handleErrorCode("xpath", using, result);
    } catch (UnexpectedJavascriptExecutionException e) {
      // Looks like the page was reloading. Fine. We didn't find the element
      throw new NoSuchElementException("Unable to find element by xpath: " + using);
    }

    return new ElementCollection(lib, parent, elements.getValue()).toList();
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.NoSuchElementException

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.