51Testing软件测试论坛

标题: 如何使用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=&quot;1&quot; Text=&quot;Summary
> Reports&quot;
> ToolTip=&quot;Summary Reports&quot;
> IsChecked=&quot;False&quot;
> Disabled=&quot;False&quot;
> DefaultStyle=&quot;padding: 3px 5px 3px 5px;
> FONT-FAMILY: Tahoma; FONT-SIZE: 11px;&quot;
> CanBeSelected=&quot;False&quot;><NODE
> Key=&quot;5&quot; Text=&quot;Basic
> Summary&quot; ToolTip=&quot;Basic Summary&quot;
> IsChecked=&quot;False&quot;
> Disabled=&quot;False&quot; />
>
> 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

WATIN有能运行JS的接口,但调用什么JS能够实现你想要的效果得你自己找。
对flytreeview控件不了解,你根本也没贴图,无从知晓你要操控的对象是什么玩意。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2