1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon.plugin.jiffie.tags;
21
22 /***
23 * This action point sets the value of any password field in form or not.
24 *
25 * Some example uses might be:
26 *
27 * Setting the value of <input type="password" name="passwordField1"</a>
28 * <pre><source>
29 * <ie-set-password-field functionId="Set a password field in a given form to 'joe'"
30 * name="passwordField1"
31 * value="joe"
32 * form="testForm"/>
33 * </source></pre>
34 * NOTE: <b>This tag does not currently support the xpath attribute nor the nested ie-attribute tags.</b>
35 * @jameleon.function name="ie-set-password-field" type="action"
36 * @jameleon.step Find the given form and set it as the working form
37 * @jameleon.step Find the given text field and set it's value
38 */
39 public class IESetPasswordFieldTag extends IEFireEventTag {
40
41 /***
42 * The name of the text field
43 * @jameleon.attribute required="true" contextName="ieSetPasswordFieldName"
44 */
45 protected String name;
46
47 /***
48 * The value to set the text field to
49 * @jameleon.attribute required="true" contextName="ieSetPasswordFieldValue"
50 */
51 protected String value;
52
53 /***
54 * The name, id or index of the field
55 * @jameleon.attribute contextName="ieSetPasswordFieldForm"
56 */
57 protected String form;
58
59 public void testBlock() {
60 if (htmlElement != null ||
61 xpath != null ||
62 getParamLength() > 0) {
63 throw new RuntimeException("htmlElement, xpath and ie-attribute are not supported by this tag");
64 }
65 setWorkingForm(form);
66 fireEvent(setPasswordFieldValue(name, value));
67 }
68 }