# set focus to the mainFrame
ie.frame( :name, "mainFrame" ).click

# get the count of links that match the criteria
ie.links( :href, /.*manish.*delete.*/ ).size.times do |iter|
  # iterate over them without relying on the collection since it will
change after each click.
  ie.links( :href, /.*manish.*delete.*/ )[i+1].click
end

something like that should work ...

j.

On 10/25/05, Manish Sapariya <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I have a app which has multiple links on same page with same
> name. However each of this link is associated with one more
> link which identifies them uniquely. To be very specific its
> the page has list of records which I can edit or delete. The
> links for edit/delete have same name, but they are assciated
> with record name.
>
> Currently I have hacked way as following.
> So I delete the record its name is/or like manish.
>
>
> -------------------------------------------
>     i = 0
>     ie.frame("mainFrame").links.each { |l|
>     i = i +1
>     if l.to_s =~ /manish/ then
>         if l.to_s =~ /delete/ then
>         print l.to_s
>         puts "\n#{i}iiiiiiiiiiiii\n"
>         ie.frame("mainFrame").link(:index, i).click
>         break;
>     end
>
>
>     end
>     }
> -------------------------------------------
>
> Is there a cleaner solution?
>
> Thanks and Regards,
> Manish
> _______________________________________________
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>


--
"http://ruby-lang.org -- do you ruby?"

Jeff Wood

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to