I checked again. I am accessing the right table.
But as u can see from the HTML below, first two rows of the table are empty.
So when I try to acess the first row,its throwing an exception.The tables are dynamic and based on user input.
I want to test if the input added has been saved. So I want to iterate through the table until I find the text.
 
HTML of the table:
<table align="center" border="0" cellpadding="0" cellspacing="0" width="200%">
                                                                <tr>
                                                                </tr>
                                                                <tr>
                                                                </tr>
                                                                <tr>
                                                                    <td align="left" bgcolor="#FFFFFF" title=""><img alt="normal" border="0" height="9" src="" width="8">&nbsp;&nbsp;<a href="" >ITEM 1</a></td>
                                                                </tr>
                                                                <tr>
                                                                </tr>
                                                                <tr>
                                                                </tr>
                                                                <tr>

amol deshpande <[EMAIL PROTECTED]> wrote:
Hi,
try using the getContents to find the text.
var = table[1][1].getContents
puts var

As far not finding the cell means (normally)that you
are accessing the wrong table with wrong arguments.
A long way to get around is to try each table index
and then locate what you are looking for.
hope this helps.
AD

--- Amitha Shetty <[EMAIL PROTECTED]>wrote:

> Dynamic tables are hidden and shown when a
> particular item is added to the pane.
> I got the table index and also the table has 9 rows
> and 1 column.
> When I try to access table[1][1](and search for a
> text there), It throws the following exception:
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2606:in
> > `[]': Unable to locate a cell at index 1
> > (Watir::Exception::UnknownCellException).
> >
> What I w! ant to do is look for the text in the row
> only if that row exists.But exists? function did not
> work for a row...How else can I do it?
>
> "Cain, Mark" <[EMAIL PROTECTED]>wrote:
> v\:* {behavior:url(#default#VML);}o\:*
> {behavior:url(#default#VML);}w\:*
> {behavior:url(#default#VML);}.shape
>
{behavior:url(#default#VML);}st1\:*{behavior:url(#default#ieooui)
> }
> What I had to do was do a view source on the page
> and find the desired table using IE’s find function
> (searched for > page I would count the number of tables (using find
> next) until I got to the desired table—the count
> number being the index of that table (I believe
> tables are zero based indexes so keep that in mind).
> Once there I could do any number of things to that
> table.
>
>
>
> Are the dynamic tables already in the page hidden
! > and shown or are they added based on user input?
>
>
>
> --Mark
>
>
> ---------------------------------
>
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Amitha Shetty
> Sent: Monday, October 17, 2005 12:34 AM
> To: [email protected]
> Subject: [Wtr-general] How to check if a particular
> row exists in a table?
>
>
>
>
>
>
>
>
> Hi,
>
>
> How to check if a particular row exists in a
> table?
>
>
>
> There are more than one table in the screen to use
>
>
> $ie.row(:id, 'row1').exists?.
>
>
> Also there are tables within a table and also
> tables are dynamic.
>
>
> When I try table[x][y].exists? I get an error which
> says:
> !
>
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2606:in
> `[]': Unable to locate a cell at index 1
> (Watir::Exception::UnknownCellException).
>
>
>
>
>
> How do I test this?
>
>
>
>
>
> Thanks,
>
>
> Amitha
>
>
>
>
>
> ---------------------------------
>
>
> Yahoo! India Matrimony: Find your partner now.
>
>
> ---------------------------------
>
>
> Yahoo! India Matrimony: Find your partner now.
>
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
> ---------------------------------
> Yahoo! India Matrimony: Find your partner now.>
_______________________________________________
> Wtr-! general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>


No Body Has ever Collided With The Sky...So Sky Is The Limit!



__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general


Yahoo! India Matrimony: Find your partner now.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to