Ejemplo n.º 1
0
 public Form check(String checkbox) {
   if (logger.isDebugEnabled()) {
     logger.debug("Checking " + checkbox);
   }
   HtmlCheckBoxInput chk = getCheckbox(checkbox);
   parent.setPage((HtmlPage) chk.setChecked(true));
   return this;
 }
Ejemplo n.º 2
0
 public void submit() {
   try {
     HtmlSubmitInput submit = form.getSubmitButton();
     if (submit != null) {
       if (logger.isDebugEnabled()) {
         logger.debug("Submiting " + form + " via submit button");
       }
       HtmlPage page = submit.click();
       parent.setPage(page);
     } else {
       if (logger.isDebugEnabled()) {
         logger.debug("Submiting " + form + " via javascript");
       }
       parent.setPage(form.submitJs());
     }
   } catch (IOException e) {
     throw new IllegalStateException("Error while submitting form", e);
   }
 }
Ejemplo n.º 3
0
 public void navigate(String element) {
   ClickableElement button = form.getInputByName(element);
   if (button == null) {
     if (logger.isDebugEnabled()) {
       logger.debug("Element " + element + " was not found by name, trying id");
     }
     button = form.getElementByIdOrDie(element);
   }
   try {
     parent.setPage((HtmlPage) button.click());
   } catch (IOException e) {
     throw new IllegalStateException(e);
   }
 }