For the first three things you listed, I see nothing with 'reportType'
listed in the HTML you posted, so I have no idea what those are trying
to do.

For the the next three things you list, There's more than one table
row in that table with the class of item which would cause two of
those three to fail because they would be looking in the row wrapped
around the 'Summary' cell and thus unable to find within that row a
cell with text 'Detail'

However on the face of things, this one here should have worked.

    $ie.table(:class, "grid-btable").div(:class,
"comboboxpp").td(:text, 'Detail').click

Knowing the exact error given for that one might be useful

Looking at the entire HTML are you sure that the 'grid-btable' class
is unique?  and that within that the class 'comboboxpp' is also
unique?   by the looks of the HTML you may have a lot of nested tables
there (I see two implicit and one inferred in the HTML you presented
so it may be that you are having an issue getting the right instance
of one of those.

an easy way to test for this is to try something like this from an IRB
prompt when you are on the right page

    $ie.tables(:class, "grid-btable").size

If there is only one, the size will be 1, if there's more than one,
then that could be your problem.


On Jan 17, 3:42 pm, Bhavesh <[email protected]> wrote:
> Hi,
>
> I have table, inside it i have table row, which interm have data
> [text] as Summary and Detail.
>
> Source code from IE is :
>
> <TABLE class=grid-btable cellSpacing=0 cellPadding=0 width="100%"
> border=0>
> <TBODY id=z_f2_rh>
> <TR class="grid " id=z_f2_sh style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Grw" z.rid="z_f2_4g"
> z.inited="true">
> <TD class=gc id=z_f2_th!chdextr style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Gcl">
> <DIV class="gc cell-inner " id=z_f2_th!cell><SPAN id=z_f2_th
> style="WIDTH: 115px">Name:</SPAN></DIV></TD>
> <TD class=gc id=z_f2_vh!chdextr style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Gcl">
> <DIV class="gc cell-inner " id=z_f2_vh!cell><INPUT class=text
> id=z_f2_vh style="WIDTH: 450px" maxLength=100
> z.type="zul.widget.Txbox"></DIV></TD>
> <TD class=gc id=z_f2_uh!chdextr style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Gcl">
> <DIV class="gc cell-inner " id=z_f2_uh!cell><SPAN id=z_f2_uh
> style="WIDTH: 115px">(Limit 100 characters)</SPAN></DIV></TD></TR>
> <TR class="grid odd" id=z_f2_0i style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Grw" z.rid="z_f2_4g"
> z.inited="true">
> <TD class=gc id=z_f2_1i!chdextr style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Gcl">
> <DIV class="gc cell-inner " id=z_f2_1i!cell><SPAN id=z_f2_1i
> style="WIDTH: 115px">Type:</SPAN></DIV></TD>
> <TD class=gc id=z_f2_4i!chdextr style="BORDER-RIGHT: white 0px solid;
> BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px
> solid; BORDER-BOTTOM: white 0px solid" z.type="Gcl">
> <DIV class="gc cell-inner " id=z_f2_4i!cell><SPAN class=combobox
> id=z_f2_4i z.type="zul.cb.Cmbox" z.combo="true"><INPUT
> class="comboboxinp readonly" id=z_f2_4i!real readOnly value=Summary
> autocomplete="off"><SPAN class=rbtnbk id=z_f2_4i!btn style="PADDING-
> BOTTOM: 2px; PADDING-TOP: 3px; POSITION: relative; TOP: 1px"><IMG
> src="https://vm-bhaveshok2.kazeon.local/reports/zkau/web/zul/img/
> combobtn.gif"></SPAN>
> <DIV class=comboboxpp id=z_f2_4i!pp style="DISPLAY: none" tabIndex=-1>
>
> <TABLE id=z_f2_4i!cave cellSpacing=0 cellPadding=0>
> <TBODY>
> <TR class=item id=z_f2_2i z.type="Cmit" z.disd="false">
> <TD></TD>
> <TD>Summary</TD></TR>
> <TR class=item id=z_f2_3i z.type="Cmit" z.disd="false">
> <TD></TD>
> <TD>Detail</TD></TR></TBODY></TABLE></DIV></SPAN></DIV></TD></TR>
>
> Im looking at last 8 lines.
>
> There is no name, class for this table.  only there is dynamic id
> generated.
>
> I want to select text "Detail: out of this combobox.
>
> Can someone help how can i do it.
>
> Im using watir webdriver.
>
> I tried like :
>
> $ie.table(:class, "grid-btable").cell(:class => "item", :text =>
> reportType).click
>
> $ie.input(:value, "Summary").select(reportType)
>
> $ie.input(:value, "Summary").select(reportType)
>
> $ie.table(:class, "grid-btable").div(:class, "comboboxpp").tr(:class,
> "item").td(:text, "Detail").click
>
>  $ie.table(:class, "grid-btable").div(:class, "comboboxpp").td(:text,
> 'Detail').click
>
> $ie.div(:class, "comboboxpp").tr(:class, "item").td(:text,
> "Detail").click
>
> But all failed with some or other error like not able to find element
> etc.
>
> Bhavesh

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to