The HTML pages that a user browses may contain forms. Some form elements may take a URL as the value.
This section is divided into the following parts:
<Form name="form1" field="visit" [valuePatterns="" source="*"]/>
name is the name of the form (mandatory)
field is the field in the form whose value needs to be rewritten (mandatory)
valuePatterns See Using Pattern Matching in Rules
source is the URL of the html page where this form definition is present (optional, default *, meaning in any page)
Assume the base URL of the page is:
Assume the page URI is form.html and is located in the root directory of the server.
<form name=form1 method=POST action= "http://test.siroe.com/testcases/html/form.html"> <input type=hidden name=abc1 value="0|1234|/test.html"> </form>
To rewrite /text.html present in the value of hidden field named abc1 which is part of form1. The following rules are needed.
<Form source="*/form.html" name="form1" field="abc1" valuePatterns="0|1234|"/> <Attribute name="action"/>
<FORM name=”form1” method=”POST” action="gateway-URL/ http://test.siroe.com/testcases/html/form.html"> <input type=hidden name=abc1 value="0|1234|gateway-URL/ http://test.siroe.com/test.html"> </FORM>
The action tag is rewritten using some defined HTML attribute rule.
The input tag attribute value’s value is rewritten as shown in the output. The specified valuePatterns is located, and all content following the matched valuePatterns is rewritten by prefixing the Gateway URL, and the base URL of the page. See Using Pattern Matching in Rules.