[Wtr-general] Wtr-general Digest, Vol 35, Issue 27

Paul Carvalho tester.paul at gmail.com
Wed Oct 25 10:56:04 EDT 2006


Hmm, that's an interesting problem.  When I first evaluated Watir to see if
it would work with our .Net web app, it was important to figure out how to
work with our tree control.  Each tree control/library out there is
different and none of the referenced examples that I could find worked for
me.

Using IRB, I tried clicking through the images, clicking on text, there were
no table cells to work with for me, tried clicking the DIV tags, and in the
end I found that I could click on the 'SPAN' tags.  It was tricky because
none of the span tags had identifiable ID or NAME labels (i.e. they were all
blank).  But where there's a will there's a way, and knowing that clicking
on the SPAN tags worked, I found a way to work around the fact that none of
them were labelled.

Scanning through your code below, I see that the tree control appears in a
single table row/cell.  It does have images associated with each of the menu
options though. That is, it looks like these images are associated with the
menu options:

- ico_attachment_pencil_24.gif  -- Code Groups
- ico_admin_add_16.gif  -- Key Person Detail
- ico_calendar_16.gif  -- Holiday Calendar
- etc.

Does clicking any of these images in that frame do what you need?



On 25/10/06, Roger Studner <oreoferret at gmail.com> wrote:
>
> This is going to be messy.. but testing ASP.NET stuff:
>
> Here is the HTML.. this is the 'left frame' of my application.. the
> frame's name is "contents"
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
>   <head>


[snip]

                            <tr>
>                                 <td valign="top"
> align="left"><?XML:NAMESPACE PREFIX=TVNS />
> <?IMPORT NAMESPACE=TVNS IMPLEMENTATION="/webctrl_client/1_0/treeview.htc"
> />
> <tvns:treeview id="tvObjectList" class="testTree"
> defaultStyle="font-size:11px;font-family:arial;font-weight:normal;"
> imageUrl="../../images/ico_C_world_16.gif"
> selectedImageUrl="../../images/ico_C_world_16.gif" selectedNodeIndex="0"
> HelperID="__tvObjectList_State__"
> systemImagesPath="/webctrl_client/1_0/treeimages/" onexpand="javascript: if
> ( this.clickedNodeIndex != null) this.queueEvent('onexpand',
> this.clickedNodeIndex)" oncollapse="javascript: if (this.clickedNodeIndex!= null)
> this.queueEvent('oncollapse', this.clickedNodeIndex)" oncheck="javascript:
> if ( this.clickedNodeIndex != null) this.queueEvent('oncheck',
> this.clickedNodeIndex)" onselectedindexchange="javascript: if (
> event.oldTreeNodeIndex != event.newTreeNodeIndex) this.queueEvent('onselectedindexchange',
> event.oldTreeNodeIndex + ',' + event.newTreeNodeIndex)">
>     <tvns:treenode Expanded="True" Selected="true" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=176&amp;ObjectName=Code
> Groups&amp;TreeSeq=53&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_attachment_pencil_24.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_attachment_pencil_24.gif"
> Target="detail" ID="53">
>         Code Groups
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=155&amp;ObjectName=Key Person
> List&amp;TreeSeq=31&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_16.gif" Target="detail" ID="31">
>         Key Person List<tvns:treenode NavigateUrl="ObjectMultiPage.aspx?ObjectId=156&amp;ObjectName=Key
> Person Detail&amp;TreeSeq=32&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_add_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_add_16.gif" Target="detail"
> ID="32">
>             Key Person Detail
>         </tvns:treenode>
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=157&amp;ObjectName=Holiday
> Calendar&amp;TreeSeq=33&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_calendar_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_calendar_16.gif" Target="detail"
> ID="33">
>         Holiday Calendar
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=160&amp;ObjectName=Fiscal
> Calendar&amp;TreeSeq=36&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_calendar_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_calendar_16.gif" Target="detail"
> ID="36">
>         Fiscal Calendar
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=158&amp;ObjectName=Product
> List&amp;TreeSeq=34&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_books_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_books_16.gif" Target="detail" ID="34">
>         Product List<tvns:treenode NavigateUrl="ObjectMultiPage.aspx?ObjectId=159&amp;ObjectName=Product
> Detail&amp;TreeSeq=35&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_books_pencil_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_books_pencil_16.gif" Target="detail"
> ID="35">
>             Product Detail
>         </tvns:treenode>
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=161&amp;ObjectName=Vendor
> List&amp;TreeSeq=37&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_16.gif" Target="detail" ID="37">
>         Vendor List<tvns:treenode NavigateUrl="ObjectMultiPage.aspx?ObjectId=162&amp;ObjectName=Vendor
> Detail&amp;TreeSeq=38&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_add_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_add_16.gif" Target="detail"
> ID="38">
>             Vendor Detail
>         </tvns:treenode>
>     </tvns:treenode><tvns:treenode Expanded="True" NavigateUrl="
> ObjectSinglePage.aspx?ObjectId=163&amp;ObjectName=Party
> List&amp;TreeSeq=39&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_16.gif" Target="detail" ID="39">
>         Party List<tvns:treenode NavigateUrl="ObjectMultiPage.aspx?ObjectId=164&amp;ObjectName=Party
> Detail&amp;TreeSeq=40&amp;moduleid=20"
> ImageUrl="/SBSDEV/Images/ico_admin_add_16.gif"
> SelectedImageUrl="/SBSDEV/Images/ico_admin_add_16.gif" Target="detail"
> ID="40">
>             Party Detail
>         </tvns:treenode>
>     </tvns:treenode>
> </tvns:treeview></td>
>                             </tr>


[snip]

I have absolutely no idea how to click/locate/use any of the TreeView (
> treeview.htc) components.
>
> Roger
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061025/cc0071f1/attachment-0001.html 


More information about the Wtr-general mailing list