标题: 如何使用watir识别flytreeview控件 [打印本页] 作者: rivercross 时间: 2010-6-3 11:09 标题: 如何使用watir识别flytreeview控件 > I am testing an ASP.NET app that uses a FlyTreeView
> control
>
>
> The HTML includes elements in node tags, which are
> links to reports in the
> AUT:
>
> <NODE Key="1" Text="Summary
> Reports"
> ToolTip="Summary Reports"
> IsChecked="False"
> Disabled="False"
> DefaultStyle="padding: 3px 5px 3px 5px;
> FONT-FAMILY: Tahoma; FONT-SIZE: 11px;"
> CanBeSelected="False"><NODE
> Key="5" Text="Basic
> Summary" ToolTip="Basic Summary"
> IsChecked="False"
> Disabled="False" />
>
> I checked a link using SpySmith and it shows as text
> enclosed in a table
> cell tag <TD>:
>
> Active Element: [TD], Index: [182]
> <TD title="Basic Summary" style="PADDING-RIGHT:
> 5px; PADDING-LEFT: 5px;
> FONT-SIZE: 11px; PADDING-BOTTOM: 3px; CURSOR: hand;
> PADDING-TOP: 3px;
> FONT-FAMI
> LY: Tahoma; TEXT-DECORATION: underline" noWrap
> width="100%">Basic
> Summary</TD>
>
> I tried to get at the link using Watir, but the cell
> text shows as one long
> string for all links:
>
> irb(main):044:0> ie.table(:id,
> 'StandardReportsTable')[1][1].text
> => "Standard Reports\r\nSummary
> Reports\r\nLoading...\r\n\r\n\r\nBasic
> Summary\r
> \nLoading...\r\n\r\n\r\n\r\nSummary by Sales
> Channel\r\nLoading...\r\n\r\n\r\n\r
> \nSummary by Price
> Level\r\nLoading...\r\n\r\n\r\n\r\nSummary by Ticket
> Type\r\n
> Loading...\r\n\r\n\r\n\r\n\r\nGeographical
> Reports\r\nLoading...\r\n\r\n\r\nSale
> s by Geographical
> Location\r\nLoading...\r\n\r\n\r\n\r\n\r\nSales by
> Day
> Reports
> \r\nLoading...\r\n\r\n\r\nSales by
> Day\r\nLoading...\r\n\r\n\r\n\r\nSales by
> Day
> by Channel\r\nLoading...\r\n\r\n\r\n\r\nSales By
> Day By Price
> Level\r\nLoading.
> ..\r\n\r\n\r\n\r\nSales by Day by Ticket
> Type\r\nLoading...\r\n\r\n\r\n\r\n\r\nE
> vent Detail Reports\r\nLoading...\r\n\r\n\r\nEvent
> Detail\r\nLoading..."
>
>
> I am stumped. I can't seem to 'click' a link using
> Watir.
>
> Does anyone have any advice? Is this even possible
> using Watir?作者: rivercross 时间: 2010-6-4 08:58
没有人关注这块么?作者: shanxi 时间: 2010-6-14 15:13 标题: 回复 1# 的帖子 试试用Java Script控制tree