Example usage for org.openqa.selenium NoSuchFrameException NoSuchFrameException

List of usage examples for org.openqa.selenium NoSuchFrameException NoSuchFrameException

Introduction

In this page you can find the example usage for org.openqa.selenium NoSuchFrameException NoSuchFrameException.

Prototype

public NoSuchFrameException(String reason, Throwable cause) 

Source Link

Usage

From source file:org.uiautomation.ios.server.command.web.SetFrameHandler.java

License:Apache License

private RemoteWebElement getIframe(String id) throws Exception {
    RemoteWebElement currentDocument = getSession().getRemoteWebDriver().getDocument();

    String selector = "iframe[name='" + id + "'],iframe[id='" + id + "'],frame[name='" + id + "'],frame[id='"
            + id + "']";
    try {/*from   www .ja v  a2s .  c  om*/
        RemoteWebElement frame = currentDocument.findElementByCSSSelector(selector);
        return frame;
    } catch (NoSuchElementException e) {
        throw new NoSuchFrameException(e.getMessage(), e);
    }

    // string|number|null|WebElement JSON Object

}