Examples of InputValue


Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

    Set<InputValue> values = new HashSet<InputValue>();

    // create some random value

    if (input.getType().toLowerCase().startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (input.getType().equalsIgnoreCase("checkbox")
            || input.getType().equalsIgnoreCase("radio") && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));

      }
    } else if (input.getType().equalsIgnoreCase("select")) {
      try {
        Select select = new Select(webElement);
        WebElement option =
                (WebElement) new RandomInputValueGenerator().getRandomOption(select
                        .getOptions());
        values.add(new InputValue(option.getText(), true));
      } catch (WebDriverException e) {
        throwIfConnectionException(e);
        return null;
      }
    }
View Full Code Here

Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

    Set<InputValue> values = new HashSet<InputValue>();

    // create some random value

    if (input.getType().toLowerCase().startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (input.getType().equalsIgnoreCase("checkbox")
            || input.getType().equalsIgnoreCase("radio") && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));

      }
    } else if (input.getType().equalsIgnoreCase("select")) {
      try {
        Select select = new Select(webElement);
        WebElement option =
                (WebElement) new RandomInputValueGenerator().getRandomOption(select
                        .getOptions());
        values.add(new InputValue(option.getText(), true));
      } catch (WebDriverException e) {
        throwIfConnectionException(e);
        return null;
      }
    }
View Full Code Here

Examples of com.crawljax.forms.InputValue

  }

  private void setRandomValues(FormInput input, WebElement webElement, Set<InputValue> values) {
    String inputString = input.getType().toLowerCase();
    if (inputString.startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (inputString.equals("checkbox") || inputString.equals("radio")
            && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));
      }
    } else if (inputString.equals("select")) {
      Select select = new Select(webElement);
      if (!select.getOptions().isEmpty()) {
        WebElement option =
                new RandomInputValueGenerator().getRandomItem(select.getOptions());
        values.add(new InputValue(option.getText(), true));
      }

    }
  }
View Full Code Here

Examples of com.crawljax.forms.InputValue

    Set<InputValue> values = new HashSet<InputValue>();

    // create some random value

    if (input.getType().toLowerCase().startsWith("text")) {
      values.add(new InputValue(new RandomInputValueGenerator()
              .getRandomString(FormHandler.RANDOM_STRING_LENGTH), true));
    } else if (input.getType().equalsIgnoreCase("checkbox")
            || input.getType().equalsIgnoreCase("radio") && !webElement.isSelected()) {
      if (new RandomInputValueGenerator().getCheck()) {
        values.add(new InputValue("1", true));
      } else {
        values.add(new InputValue("0", false));

      }
    } else if (input.getType().equalsIgnoreCase("select")) {
      try {
        Select select = new Select(webElement);
        WebElement option =
                (WebElement) new RandomInputValueGenerator().getRandomOption(select
                        .getOptions());
        values.add(new InputValue(option.getText(), true));
      } catch (WebDriverException e) {
        throwIfConnectionException(e);
        return null;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.