- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-15-2008 02:00 AM
Solved! Go to Solution.
Re: How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-15-2008 08:35 AM
iTest's web application works by creating what we call a "map" of each web page. This map describes all of the objects on the page (tables, spans, buttons, images, etc.) This map is an XML document with one tag representing each object and organized in a hierarchy matching the containment. In fact, the document is almost identical to the HTML describing the page, except fixed to become proper XML. If you are familiar with how browser internals work, our map is actually the DOM used internally to the browser. In other words, we identify objects more or less the same way that it is done by javascript on the page.
Our targets are mostly XPATH queries that operate on the XML map to identify a node in the DOM. We also support a few special syntaxes other than XPATH for convenience such as link=foo which is a shorthand way of writing an XPATH query that finds an object that has an href and the text "foo". But if one of these simple shorthand ways isn't sufficient, then any valid XPATH expression is acceptable that will return a node in the document. From that we find the corresponding object in the DOM and take action on it.
In this example, then //TR[4]/TD[2] is a target that is an XPATH expression. It says, "Look everywhere in the DOM for nodes called 'TR'. Take the fourth one of these, and then under it, take the second node called 'TD'."
You can look at the DOM by using the showPage action as a step in your test case. It will dump out the full DOM in the response.
It's important to understand that the DOM does not necessarily match the HTML returned by the server. That's because client-side javascript can manipulate the DOM directly. So after the page loads, the script on the page might continue to change the DOM. This is very common in so-called "web 2.0" or "AJAX" applications. Happily, iTest is using the underlying DOM itself, and so works very well with these active web applications.
Re: How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-16-2008 06:44 AM
Re: How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-16-2008 11:03 AM
Yes. Open the Structure view. While you have the snapshot step selected, the Structure view should show you the DOM for the page. If you select a node in the tree in this view (corresponding to an object on the web page), then the textbox at the top of the Structure view will show you one possible XPATH to get to that object. You can also use alternative XPATH queries in that textbox and when you click Evaluate, it will show you the matching nodes. This can be a very useful tool for trying out different target variants.
I won't go into it here, but you may want to consider using form maps. These let you construct a list of named targets so that you don't have to keep figuring out XPATH each time.
Re: How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-16-2008 11:05 AM
Re: How does iTest identify/n ame an object which does not have any window id or name mapped
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-16-2008 11:28 AM
