Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriverException


        return tmp.split("/")[0];
      } else {
        return tmp;
      }
    } else {
      throw new WebDriverException("cannot extract session id from " + pathInfo);
    }
  }
View Full Code Here


  private static Instruments getImplementation(Class clazz, ServerSideSession serverSideSession) throws Exception{
    try {
      Constructor c = clazz.getConstructor(ServerSideSession.class);
      return (Instruments)c.newInstance(serverSideSession);
    } catch (NoSuchMethodException e) {
      throw new WebDriverException(
          "The instruments implementation must have a constructor taking a ServerSideSession as a parameter.");
    } catch (InvocationTargetException e){
      throw (Exception)e.getTargetException();
    }
  }
View Full Code Here

          for (WebkitPage p : driver.getPages()) {
            m.getPages().remove(p);
          }

          if (m.getPages().size() == 0) {
            throw new WebDriverException(m.getPages().size() + " new pages.");
          }

          // TODO there can be more than one 'new' UIWebView, picking the max one for now.
          WebkitPage newOne = Collections.max(m.getPages());
          pages.addAll(m.getPages());
View Full Code Here

        Instruments instruments = getImplementation(implClazz, session);
        if (instruments.isCompatible(session)) {
          return instruments;
        }
    }
    throw new WebDriverException("Cannot find a valid implementation for the session " + session);
  }
View Full Code Here

  public UIAScriptResponse executeCommand(UIAScriptRequest request) {
    handleLastCommand(request);
    if (isReady()) {
      requestQueue.add(request);
    } else {
      throw new WebDriverException(COM_WITH_INSTRUMENTS_DOWN);
    }
    return waitForResponse();
  }
View Full Code Here

        return tmp.split("/")[0];
      } else {
        return tmp;
      }
    } else {
      throw new WebDriverException("cannot extract session id from " + pathInfo);
    }
  }
View Full Code Here

    JSONObject logElementTree = driver.logElementTree(null, false);
    JSONObject tree = logElementTree.optJSONObject("tree");
    try {
      return new XPath2Engine(new JSONToXMLConverter(tree).asXML());
    } catch (Exception e) {
      throw new WebDriverException(e);
    }
  }
View Full Code Here

  public List<Map<String, String>> findElementsByXpath(String xpath) {
    try {
      return findElementsByXpath(xpath, document);
    } catch (XPathExpressionException e) {
      throw new WebDriverException(e);
    }
  }
View Full Code Here

    return reference;
  }

  protected XPath2Engine getParser() {
    if (!xpathMode) {
      throw new WebDriverException("Bug. parser only apply to xpath mode.");
    }
    return XPath2Engine.getXpath2Engine(getSession().getDualDriver().getNativeDriver());
  }
View Full Code Here

    return XPath2Engine.getXpath2Engine(getSession().getDualDriver().getNativeDriver());
  }

  protected String getXpath() {
    if (!xpathMode) {
      throw new WebDriverException("Bug. parser only apply to xpath mode.");
    }
    String original = getRequest().getPayload().optString("value");
    return getAUT().applyL10N(original);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.WebDriverException

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.