1 package com.ibm.staf.service.http.html;
2 
3 /*****************************************************************************/
4 /* Software Testing Automation Framework (STAF)                              */
5 /* (C) Copyright IBM Corp. 2004                                              */
6 /*                                                                           */
7 /* This software is licensed under the Eclipse Public License (EPL) V1.0.    */
8 /*****************************************************************************/
9 
10 import java.util.HashMap;
11 import java.util.Vector;
12 // xerces
13 import com.ibm.staf.service.http.WebSession;
14 import org.w3c.dom.html.HTMLInputElement;
15 import org.w3c.dom.html.HTMLCollection;
16 import org.w3c.dom.html.HTMLFormElement;
17 import org.w3c.dom.html.HTMLAnchorElement;
18 import org.w3c.dom.html.HTMLAreaElement;
19 
20 /*****************************************************************************/
21 /*                                                                           */
22 /* Class: WebElement                                                         */
23 /* Description: This class provides the handle to manipulate html document   */
24 /*              components that can be transformed into http requests.       */
25 /*                                                                           */
26 /*****************************************************************************/
27 
28 public abstract class WebElement
29 {
30     String id;
31     String name;
32     int index;
33     public static final String NAME="NAME";
34     public static final String ID="ID";
35     public static final String INDEX="INDEX";
36 
37 /*****************************************************************************/
38 /*                                                                           */
39 /* Method: Constructor                                                       */
40 /* Description: Constructor method                                           */
41 /* Parameter: none                                                           */
42 /*                                                                           */
43 /*****************************************************************************/
44 
WebElement()45     WebElement()
46     {
47         name = null;
48         id = null;
49         index = -1;
50     }
51 
52 /*****************************************************************************/
53 /*                                                                           */
54 /* Method: Constructor                                                       */
55 /* Description: Constructor method                                           */
56 /* Parameter: id - id of this element                                        */
57 /*            name - name of this element                                    */
58 /*            index - index of this element in the list of elements of this  */
59 /*                    type                                                   */
60 /*                                                                           */
61 /*****************************************************************************/
62 
WebElement(String id, String name, int index)63     WebElement(String id, String name, int index)
64     {
65         this.name = name;
66         this.id = id;
67         this.index = index;
68     }
69 
getName()70     public String getName()
71     {
72         return name;
73     }
74 
getId()75     public String getId()
76     {
77         return id;
78     }
79 
80 /*****************************************************************************/
81 /*                                                                           */
82 /* Method: getRequest                                                        */
83 /* Description: get the hash describing the http request associated with this*/
84 /*              html element.                                                */
85 /* Parameters: none                                                          */
86 /* Returns: description of a http request                                    */
87 /*                                                                           */
88 /*****************************************************************************/
89 
getRequest()90     public abstract HashMap getRequest();
91 
92 /*****************************************************************************/
93 /*                                                                           */
94 /* Method: getSummary                                                        */
95 /* Description: get a summary of the link.                                   */
96 /* Parameters: none                                                          */
97 /* Returns: description of a element                                         */
98 /*                                                                           */
99 /*****************************************************************************/
100 
getSummary()101     public abstract HashMap getSummary();
102 
103 } // end class WebElement
104