Package org.openqa.selenium

Examples of org.openqa.selenium.NoSuchFrameException


    List<RemoteWebElement> iframes = getWebDriver().findElementsByCssSelector(
        "iframe,frame");
    try {
      return iframes.get(index);
    } catch (IndexOutOfBoundsException i) {
      throw new NoSuchFrameException(
          "detected " + iframes.size() + " frames. Cannot get index = " + index);
    }
  }
View Full Code Here


        + "']";
    try {
      RemoteWebElement frame = currentDocument.findElementByCSSSelector(selector);
      return frame;
    } catch (NoSuchElementException e) {
      throw new NoSuchFrameException(e.getMessage(), e);
    }

    // string|number|null|WebElement JSON Object
  }
View Full Code Here

    buildRuntimeTree();

    RuntimeNode node = root.getNodes().get(index + 1);

    if (node == null) {
      throw new NoSuchFrameException("Invalid frame index " + index);
    }

    Runtime info = runtimesList.get(node.getRuntimeID());
    currentFramePath = info.getHtmlFramePath();
    setRuntime(info);
View Full Code Here

        break;
      }
    }

    if (curr == null) {
      throw new NoSuchFrameException("Invalid frame name " + frameName);
    }

    Runtime info = runtimesList.get(curr.getRuntimeID());

    // We should only find frames underneath the current one.
    if (!info.getHtmlFramePath().startsWith(currentFramePath)) {
      throw new NoSuchFrameException("No such frame " + frameName + " in " + currentFramePath);
    }

    currentFramePath = info.getHtmlFramePath();
    setRuntime(info);
  }
View Full Code Here

    buildRuntimeTree();

    RuntimeNode node = root.getNodes().get(index + 1);

    if (node == null) {
      throw new NoSuchFrameException("Invalid frame index " + index);
    }

    RuntimeInfo info = runtimesList.get(node.getRuntimeID());
    currentFramePath = info.getHtmlFramePath();
    setRuntime(info);
View Full Code Here

    RuntimeNode curr = root;

    curr = findNodeByName(frameName, curr);

    if (curr == null) {
      throw new NoSuchFrameException("Invalid frame name " + frameName);
    }

    RuntimeInfo info = runtimesList.get(curr.getRuntimeID());

    // We should only find frames underneath the current one.
    if (!info.getHtmlFramePath().startsWith(currentFramePath)) {
      throw new NoSuchFrameException("No such frame " + frameName + " in " + currentFramePath);
    }

    currentFramePath = info.getHtmlFramePath();
    setRuntime(info);
  }
View Full Code Here

    public WebDriver frame(int frameIndex) {
      int framesLength =
          Integer.valueOf(debugger.executeJavascript("return document.frames.length"));

      if (frameIndex < 0 || frameIndex >= framesLength) {
        throw new NoSuchFrameException("Invalid frame index: " + frameIndex);
      }

      debugger.changeRuntime(frameIndex);

      return OperaDriver.this;
View Full Code Here

          (Long) debugger.callFunctionOnObject(script,
                                               ((OperaWebElement) frameElement).getObjectId(),
                                               true);

      if (frameIndex == null) {
        throw new NoSuchFrameException("Non-frame element or frame not in current DOM");
      }

      debugger.changeRuntime(frameIndex.intValue());

      return OperaDriver.this;
View Full Code Here

    
    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:
View Full Code Here

        final WebWindow topWindow = currentWindow.getTopWindow();
        final HtmlPage topPage = (HtmlPage) topWindow.getEnclosedPage();
        try {
          currentWindow = topPage.getFrames().get(index);
        } catch (IndexOutOfBoundsException e) {
          throw new NoSuchFrameException("Cannot find frame: " + index);
        }
      }
      return HtmlUnitDriver.this;
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.NoSuchFrameException

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.