Troubleshooting a Form Fill Policy

When a new Form Fill policy does not behave as expected, use the following tips to find the cause:

  • Select Debug Mode. This option prepares the form for submission, but does not submit the form until you click Submit. This allows you to view the source and determine if the policy is generating the required data.

  • Ensure that all input fields have valid names, that the fields are being filled in the correct order, and that any JavaScript commands have been entered correctly.

  • Enable Form Fill logging. Form Fill is a function of both the proxy service and the Embedded Service Provider. The Embedded Service Provider logs the evaluation of the policy, and the proxy logs the process of gathering the data. To enable the Embedded Service Provider tracing, see Turning on Logging for Policy Evaluation. To enable Access Gateway log entries for Form Fill policies, see Enabling Form Fill Logging.

Check for the following problems with the source content of the Form Fill page:

Valid HTML Structure

The Form Fill process aborts if the page does not contain valid HTML structure. The page must contain the <html></html> tags, and the form must contain the <form></form> tags. If these tags are missing, you must correct the source page on the web server. If this is not possible, you can create a rewriter policy to add the tags.

  • To add the <html> tag, have the rewriter policy search for the <body> tag, and replace it with <html><body>.

  • To add the </html> tag, have the rewriter policy search for the </body> tag, and replace it with </body></html>.

  • Use similar entries to add the <form></form> tags. You’ll need to discover which tag or phrase starts and stops the form.

Configure your rewriter policy so that it runs before the default rewriter policy. For more information about rewriter policies, see Section 2.7.6, Configuring HTML Rewriting.

The Option Element Does Not Contain a Value Attribute

If an <option> element does not contain a value attribute, Form Fill cannot fill the value. For example:

<form action="select.htm">
   <select name="top2">
      <option>Bob</option>
      <option>Alice</option>
   </select>
</form>

If your form contains <option> elements similar to these, they need to rewritten to contain a value attribute. For example:

<form action="select.htm">
   <select name="top2">
      <option value="name1">Bob</option>
      <option value="name2">Alice</option>
   </select>
</form>

If possible, change the source page on the web server to add the value attribute to the <option> elements. If this is not possible, you can use a rewriter policy to add the value attribute.

  • For the Bob option, have the rewriter policy search for <option>Bob and replace it with <option value="name1">Bob.

  • For the Alice option, have the rewriter policy search for <option>Alice and replace it with <option value="name1">Alice.

Configure your rewriter policy so that it runs before the default rewriter policy. For more information about rewriter policies, see Section 2.7.6, Configuring HTML Rewriting.

The Form Element Does Not Contain a Method Attribute

If the <form> element does not contain a method attribute, Form Fill does not run an Auto Post. For example, the following form cannot use an Auto Post.

<form name="loginForm">

To enable Form Fill so that it can run an Auto Post, you need to add a method attribute to the <form> element. For example:

<form method="get" action="index.htm" name="loginForm">

If possible, change the source page on the web server to add the method attribute to the <form> element. If this is not possible, you can use a rewriter policy to add the method attribute.

  • Search for <form

  • Replace this string with <form method="get" action="index.htm"

Configure your rewriter policy so that it runs before the default rewriter policy. For more information about rewriter policies, see Section 2.7.6, Configuring HTML Rewriting.