John.Ji...@gmail.com
unread,Oct 23, 2008, 2:02:45 PM10/23/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tellurium-users
In Tellurium UI module, you often see the "group" attribute, for
example,
ui.Container(uid: "google_start_page", clocator: [tag: "td"], group:
"true"){
InputBox(uid: "searchbox", clocator: [title: "Google Search"])
SubmitButton(uid: "googlesearch", clocator: [name: "btnG", value:
"Google Search"])
SubmitButton(uid: "Imfeelinglucky", clocator: [value: "I'm Feeling
Lucky"])
}
What does the attribute "group" mean? The group attribute is a flag
for the
Group Locating Concept (GLC). By default, this option is off. To use
the Group
Locating Concept, you have to specify the attribute "group" to be
true.
Usually, the XPath generated by Selenium IDE, XPather, or other tools
is a single
path to the target node such as
//div/table[@id='something']/div[2]/div[3]/div[1]/div[6]
No sibling node's information is used here. This is very much like
saying
"my name is A, my father's name is B, my grandfather's name is C, ..."
What is wrong with this? The xpath depends on too much information
from
nodes away from the target node. In Tellurium, we try to localize the
information and reduce the dependence by using sibling information or
local information, that is similar to,
"my name is A, my sister's name is B, my brother's name is C, my son's
name is D, ..."
The Group Locating Concept is based on this observation and it
exploits the
information in a group of UI elements to locate itself. In the above
google UI module, the group locating concept will try to find the "td"
tag
with its children as "InputBox", "googlesearch" button, and
"Imfellingluck" button.
If you look at the log, you will see the runtime XPath will use the
"and"
operator to add the sibling/child attributes in. How the runtime XPath
is generated will be introduced in another tutorial.
Right now, Tellurium only considers level 1 Group Locating, i.e., only
the
current node's child nodes are used to define the XPath. For more
general
case, any node inside the group of UI elements could be used to define
the
runtime XPath.