Package org.openqa.selenium

Examples of org.openqa.selenium.NoSuchElementException


    {
        try {
            return getWrappedDriver().findElement(by);
        } catch (NoSuchElementException e) {
            this.utils.takeScreenshot();
            throw new NoSuchElementException("Failed to locate element from page source [" + getPageSource() + "]", e);
        }
    }
View Full Code Here


            @Override
            public Object getTarget() {
                try {
                    return dropProxyAndFindElement(by, searchContext);
                } catch (NoSuchElementException ex) {
                    throw new NoSuchElementException((by instanceof ByIdOrName ? EMPTY_FIND_BY_WARNING : "") + ex.getMessage(),
                            ex);
                }
            }
        });
    }
View Full Code Here

      }
    }
   
    if ( renderedWebElement == null )
    {
      throw new NoSuchElementException( "Could not locate assync content" );
    }
   
    try
    {
      if ( renderedWebElement.isDisplayed() )
      {
        throw new NoSuchElementException( "Element is not being displayed" );
      }
    }
    catch (Throwable t)
    {
      LOGGER.debug(t.getMessage(), t);
View Full Code Here

      }
    } while (System.currentTimeMillis() < deadline);

    if (rwe == null) {
      throw new NoSuchElementException(
          "No element found for " + getRequest().getPayload() + " after waiting for " + implicitWait
          + " ms.");
    } else {
      JSONObject res = new JSONObject();
      res.put("ELEMENT", rwe.getReference());
View Full Code Here

  private Map<String, String> findElementByXpath(String xpath, Node from)
      throws XPathExpressionException {
    XPathExpression expr = xpath2.compile(xpath);
    Element el = (Element) expr.evaluate(document, XPathConstants.NODE);
    if (el == null) {
      throw new NoSuchElementException("No element for xpath " + xpath);
    }

    checkIfElementIsAccessible(el);
    String reference = el.getAttribute("ref");
    String type = el.getNodeName();
View Full Code Here

  private Node getNode(String reference) throws XPathExpressionException {
    String xpath = "//*[@ref=" + reference + "]";
    XPathExpression expr = xpath2.compile(xpath);
    Node n = (Node) expr.evaluate(document, XPathConstants.NODE);
    if (n == null) {
      throw new NoSuchElementException("Element with ref " + reference + " doesn't exist.");
    }
    return n;
  }
View Full Code Here

    Integer id = debugger.executeScriptOnObject(using, objectId);
    if (id != null) {
      return new OperaWebElement(parent, id);
    }

    throw new NoSuchElementException("Cannot find element with " + type);
  }
View Full Code Here

  private List<WebElement> findMultipleElements(String using, String type) {
    Integer id = debugger.executeScriptOnObject(using, objectId);

    if (id == null) {
      throw new NoSuchElementException("Cannot find element(s) with " + type);
    }

    return parent.processElements(id);
  }
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 " + by);
    }
  }
View Full Code Here

    if (id != null) {
      return elements;
    }

    throw new NoSuchElementException("Cannot find element(s) with " + by);
  }
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.