Signatures for frames
A frame displays multiple HTML documents in the same browser window. An iframe or inline frame, is an HTML document that is embedded inside another HTML document.
About frames
Each HTML document is called a frame. Each frame is independent of each other. The tags <frameset> and <frame> defines frames in a web page. An iframe HTML element is often used to insert content from another source, such as an advertisement, into a Web page. Use the tag <iframe> to embed another HTML document.Frame and iframe are similar except that iframe is more flexible because you can embed another HTML document in the web page like embedding an image or any other HTML element. In a frame, you must define the structure of the framesets in a main web page. However, they are treated the same way in generating signatures.
- Each frame in a web page has its own instance of state engine. These different state engines can be instantiated from the same AccessProfile or different AccessProfiles depending on the URL you specified in the site signature. However, you typically group all different frame URLs into one single AccessProfile.
- In your signature, root segment /child::html always refers to the document where the current state engine resides. If your state engine is loaded in an HTML page that resides in a frame, /child::html does not refer to the top-most document, but the HTML document that your state engine is in.
- /child::html/parent::frame/parent::frame points you to the top-most frame. Remember that you must use two parent or frame.
- To navigate to a particular document from the top-most
frame,
use the following signature:
/descendent::document[@url#...#]
One-level nested frame
For an ordinary one level nested frame, the main.html consists of two frame web pages, page_a.html and page_b.html
| Frame | Signature |
|---|---|
| main.html |
|
| page_a.html |
|
| page_b.html |
|
/child::html/parent::frame/parent::frame/descendent::document[@url#".*page_a.*"]
/descendent::html[@tag_name="form"]/descendent::html[@tag_name="input"]
Multi-nested frame
You might experience a complicated scenario where frame page contains another frameset, such as a multi-nested frame.
In the following example, the main page contains two frames, the first frame contains page_a.html, the second frame contains page_b.html. The frame page_b.html contains a frameset with two pages: page_c.html and page_d.html.
| Frame | Signature |
|---|---|
| main page |
|
| page_a.html |
|
| page_b.html |
|
| page_c.html |
|
| page_d.html |
|
/descendent::html[@tag_name="input" and @name="i_c"]
/child::html/parent::frame/parent::frame/descendent::document[@url#".*page_c.*"]
/descendent::html[@tag_name="form"]/descendent::html[@tag_name="input"]
Embedding another frame inside a web document using an iframe tag
| Frame | Signature |
|---|---|
| main page |
|
| page_a.html |
|
/descendent::html[@tag_name="form" and @name="f_a"]/child::html[@tag_name="input"
and @name="i_a" and @type="text"]
/child::html/parent::frame/parent::frame/child::document[@url#".*main.*]
/descendent::html[@tag_name="div"]
Cross-domain sites
A cross-domain web page is when an HTML document from one frame belongs to a different domain from the HTML document from another frame.
From Web script language (such as a JavaScript embedded inside an HTML source), you cannot access another cross-domain frame document for some security reasons. However, for the AccessStudio signature framework, cross-domain site signatures work because the signature evaluation algorithm uses a different approach that bypasses this security barrier. You do not have to worry about cross-domain sites when writing frame-related signatures.