Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriverException


    {
        int x = 0;
        while (checkBoxElement.isSelected() != checked) {
            checkBoxElement.click();
            if (x == 100) {
                throw new WebDriverException("Unable to set checkbox at " + checkBoxElement.getAttribute("name")
                    + " to " + checked);
            }
            x++;
        }
    }
View Full Code Here


        private Map<String, WebElement> optionsByValue;

        public SelectElement(WebElement select)
        {
            if (!select.getTagName().toLowerCase().equals("select")) {
                throw new WebDriverException("Can only create a select element from a webelement of tag name select.");
            }
            this.select = select;
        }
View Full Code Here

        }

        public void select(List<String> valuesToSelect)
        {
            if (valuesToSelect.size() > 1 && this.select.getAttribute("multiple") != "multiple") {
                throw new WebDriverException("Cannot select multiple elements in drop down menu.");
            }
            Map<String, WebElement> optionsByValue = getOptionsByValue();
            if (!optionsByValue.keySet().containsAll(valuesToSelect)) {
                throw new WebDriverException("Select Element(s): " + optionsByValue.keySet().retainAll(valuesToSelect)
                    + " not found.");
            }
            for (String label : valuesToSelect) {
                optionsByValue.get(label).click();
            }
View Full Code Here

        public void unSelect(List<String> valuesToUnSelect)
        {
            Map<String, WebElement> optionsByValue = getOptionsByValue();
            if (!optionsByValue.keySet().containsAll(valuesToUnSelect)) {
                throw new WebDriverException("Select Element(s) to unselect: "
                    + optionsByValue.keySet().retainAll(valuesToUnSelect) + " not found.");
            }
            for (String label : valuesToUnSelect) {
                if (optionsByValue.get(label).isSelected()) {
                    optionsByValue.get(label).click();
View Full Code Here

      }
    }

    private String localizeString(String value) {
      if (clientSideL10n == null) {
        throw new WebDriverException(
            "you need to provide client side content to use the client side l10n");
      }
      String res = clientSideL10n.get(value);
      if (res == null) {
        throw new WebDriverException("no client side content provided for " + value);
      } else {
        return res;
      }
    }
View Full Code Here

        element.setFileDetector(driver.getFileDetector());
        element.setParent(driver);
        element.setId(ref);
        return (RemoteIOSObject) o;
      } catch (Exception e) {
        throw new WebDriverException("error casting", e);
      }
    } else {
      RemoteWebElement element = new RemoteWebElement();
      element.setFileDetector(driver.getFileDetector());
      element.setId(ref);
View Full Code Here

          return null;
        } else if ("getConfiguration".equals(method.getName())) {
          WebDriverLikeCommand command = (WebDriverLikeCommand) args[0];
          return RemoteIOSDriver.getConfiguration(executor, command);
        } else {
          throw new WebDriverException(method.getName() + " isn't recognized for Configurable");
        }
      }
    };
  }
View Full Code Here

  public URL getURL() {
    URL url;
    try {
      url = new URL("http://localhost:" + server.getHostInfo().getPort() + "/wd/hub");
    } catch (MalformedURLException e) {
      throw new WebDriverException(e.getMessage(), e);
    }
    return url;
  }
View Full Code Here

   * Most actions can be performed using the normal augmented driver, but for findElement, the
   * findElement(s) must be override, so need to create a new object from scratch.
   */
  public static RemoteIOSDriver getIOSDriver(RemoteWebDriver driver) {
    if (!(driver.getCommandExecutor() instanceof HttpCommandExecutor)) {
      throw new WebDriverException("ios only supports http commandExecutor.");
    }
    HttpCommandExecutor e = (HttpCommandExecutor) driver.getCommandExecutor();
    RemoteIOSDriver
        attach =
        new AttachRemoteIOSDriver(e.getAddressOfRemoteServer(), driver.getSessionId());
View Full Code Here

          return RemoteIOSDriver.findElement(executor, criteria);

        } else if ("findElements".equals(method.getName())) {
          return RemoteIOSDriver.findElements(executor, criteria);
        } else {
          throw new WebDriverException(method.getName() + " isn't recognized for Configurable");
        }
      }
    };
  }
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.