A Web application is a series of pages considered to be a part of the same overall application. Each landmark must be defined in a manner in which the landmark identifier can distinguish each page from every other. This approach means that there must be flexibility in how landmark identifiers are determined. While you can always use the class
attribute and write your own Java code to return a unique value, a Web browser container has several tags that can be used for the same purpose.
The following tags are supported for this container:
- URL - The default, if not specified
- \$URL - the URL for the page
- \$URI - the URI for the page
- \$TITLE - the page title
- \$META-xxx - a meta element where xxx is the name attribute
The only tag that might need more explanation is the \$META-xxx
tag. This tag uses the name
attribute, where xxx
is defined and the value returned is the value contained in the content
HTML with the following element
meta name="author" content="John Smith" />
can be defined in the target builder as such:
Web browser container field identifiers
The field identifiers for the Web browser container are id
, and xpath
. These identifiers are used in the field attribute of get and put events.
- id – the ID of the DOM element
- name – the name of the DOM element
- tag – the element tag name of the DOM element
- xpath – the xpath to a specific DOM element
The xpath identifier allows practically any DOM element to be returned. While it is powerful, there are some limitations. The first is that accessing the DOM using the xpath is much slower than looking up an element by name or ID. Second, the xpath might not be a good fit for some HTML pages as elements in tables might be different based on the content. One feature that makes xpath lookups faster is the use of a wild element pattern, where you specify //* [@id=
in the front of the xpath. The system first performs a find by element ID, searching the remaining child notes down to the target leaf. The following is an example of this optimization being used in the put action of an event:
Web browser container events
The Web browser container supports all four of the following events:
- contentComplete – This event occurs when the current Web page is loaded. All actions in this event are executed serially.
- dataChange – This event occurs either when a property change is coming into the container or when a DOM element is changed in the container.
- viewInit - This event occurs when the specific component (the view part) opens initially.
- viewClose - This event occurs when the specific component (the view part) closes.
Parent topic: Generic application container framework: XPD622