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 where the landmark identifier can distinguish each page from every other. This means 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 which may 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" />
...would 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 very powerful, there are some limitations. The first is that accessing the DOM using the xpath is much slower then looking up an element by name or ID. Secondly, the xpath may not be a good fit for some HTML pages as elements in tables may 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 completed 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: XPD621