[wtr-general] Clicking a div with last index

2010-06-28 Thread Ajitesh Srinetra
At present in my Web Page I can See a lot of divs and i access them
using indexes using this code

ie.div(:text = 'div',:index =1).click
ie.div(:text = 'div',:index =2).click
ie.div(:text = 'div',:index =3).click
ie.div(:text = 'div',:index =4).click

Is there any way I can click on the last Index directly like
ie.div(:text = 'div',:index =Last).click



-- 
Thanks and Regards
Ajitesh Srinetra

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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Clicking a div with last index

2010-06-28 Thread kiran yajamanyam
Do you have any other attribute value other than :text='div' ? Like class
or ID . If you have any other value you can directly use them.

-K

On Fri, Jun 25, 2010 at 6:33 PM, Ajitesh Srinetra 
ajitesh.srine...@gmail.com wrote:

 At present in my Web Page I can See a lot of divs and i access them
 using indexes using this code

 ie.div(:text = 'div',:index =1).click
 ie.div(:text = 'div',:index =2).click
 ie.div(:text = 'div',:index =3).click
 ie.div(:text = 'div',:index =4).click

 Is there any way I can click on the last Index directly like
 ie.div(:text = 'div',:index =Last).click



 --
 Thanks and Regards
 Ajitesh Srinetra

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

 You received this message because you are subscribed to
 http://groups.google.com/group/watir-general
 To post: watir-general@googlegroups.com
 To unsubscribe: 
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Clicking a div with last index

2010-06-28 Thread Željko Filipin
On Fri, Jun 25, 2010 at 3:03 PM, Ajitesh Srinetra 
ajitesh.srine...@gmail.com wrote:
 Is there any way I can click on the last Index directly like
 ie.div(:text = 'div',:index =Last).click

I do not think we have something like that.

Maybe you would be able to do it with xpath:

http://wiki.openqa.org/display/WTR/XPath

Željko

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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com