[wtr-general] Re: :index = 0 with firewatir

2009-08-18 Thread Alexandre

Le vendredi 14 août de l'année 2009, vers 20 heures et 20 minutes, Jari Bakken 
écrivait:
 The best solution for getting the last item in this case is:
 browser.links.select { |l| l.text == 'foo' }.last

That is exactly what I was looking for.
(And yes I had to search in text)
thank you for help

-- 
Alexandre Delanoë

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-15 Thread Michael Hwee

I would rather use
browser.links.length
This is already 1-based.




- Original Message 
From: Jari Bakken jari.bak...@gmail.com
To: watir-general@googlegroups.com
Sent: Friday, August 14, 2009 11:20:30 AM
Subject: [wtr-general] Re: :index = 0 with firewatir


On Fri, Aug 14, 2009 at 5:49 PM, Michael Hweemichael_h...@yahoo.com wrote:

 : index= 0 is not the last item.


Well, that depends on how the 1-indexed Watir collections are implemented. :)

The best solution for getting the last item in this case is:

browser.links.select { |l| l.text == 'foo' }.last


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-15 Thread Jari Bakken

On Sat, Aug 15, 2009 at 8:06 AM, Michael Hweemichael_h...@yahoo.com wrote:

 I would rather use
 browser.links.length
 This is already 1-based.

Yep, only problem is that he wants to filter by text.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-14 Thread Michael Hwee

: index= 0 is not the last item.




- Original Message 
From: Alexandre neonoe123...@gmail.com
To: WATIR watir-general@googlegroups.com
Sent: Friday, August 14, 2009 5:40:55 AM
Subject: [wtr-general] :index = 0 with firewatir


Hello,
using firewatir, ff.link(:text = foo,:index = 2).click  works fine
but I would like to click on the last link found on the page.
Then ff.link(:text = foo,:index = 0).click should work.
But firewatir can not find this element.
Do you have another solution ?
Thank you.

-- 
Alexandre Delanoë


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: :index = 0 with firewatir

2009-08-14 Thread Jari Bakken

On Fri, Aug 14, 2009 at 5:49 PM, Michael Hweemichael_h...@yahoo.com wrote:

 : index= 0 is not the last item.


Well, that depends on how the 1-indexed Watir collections are implemented. :)

The best solution for getting the last item in this case is:

browser.links.select { |l| l.text == 'foo' }.last

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---