Christopher Dicely
4/3/2008 1:30:00 PM
On Thu, Apr 3, 2008 at 2:07 AM, Pranjal Jain <pranjal.jain123@gmail.com> wrote:
> Hi
> I am having a doubt regarding the basic ruby.
>
> I want to access the row 7 in the table 9 of a web page. If I am trying
> to access table only I am not facing any problem(i.e)
>
> $ie.table(:id =>"", :index =>9).flash(20)
>
> But if I am trying to access a row inside a table, it gives me error.
> The command I used is as follows:
>
> $ie.table(:id =>"", :index =>9).row(:value => "",:index => 7).flash(20)
>
> The error I get is as follows:
> Loaded suite temporary
> Started
>
> Web page opened successfully
> .E
> Finished in 15.852 seconds.
>
> 1) Error:
> test_b(TestCase):
> NoMethodError: private method `row' called for #<Watir::Table:0x2dff1f4>
> temporary.rb:88:in `test_b'
>
> 2 tests, 0 assertions, 0 failures, 1 errors
>
> Can anyone suggest how to overcome this problem ?
> Thanks in advance.
I've never used Watir, but the rdocs for Watir::Table seem to suggest that
what you need to do is something like this, if $ie.table(id=>"", :index=>9) is
getting the table you want:
$ie.table(:id =>"", :index =>9)[7].flash(20)