[wtr-general] Re: click method with list items

2009-07-21 Thread Ivan Kabluchkov

Try to raise javascript event

$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).fire_event('onClick')

On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
 Hi,
 I have list structure like this,

 ul id=cntList class=chartsdul style=display: block;
 li
 a id= onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
 ('1'); href=http://www.winamp.com/music/top-artists/all/today;
 onclick=TopArtist.selectitem(id)World Wide/a
 /li
 li
 a id=arg onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
 ('1'); href=http://www.winamp.com/music/top-artists/argentina;
 onclick=TopArtist.selectitem(id) Argentina /a
 /li
 /ul

      $browser.ul(:id, cntList).lis.each{|list_item|

            puts list_item.text()

     }
 list_item.flash() or $browser.ul(:id, cntList).li(:index, 1).link
 (:text, World Wide).exists?()  both are locating the object but i am
 not able to perform click operation on the links embedded inside li
 tag , could some give me inputs ?
 Thanks in advance
 -Basu
--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread Basavana Gowda K S
Hi Ivan,

That option is also not working

On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov ikabluch...@gmail.comwrote:


 Try to raise javascript event

 $browser.ul(:id, cntList).li(:index, 1).link(:text, World
 Wide).fire_event('onClick')

 On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
  Hi,
  I have list structure like this,
 
  ul id=cntList class=chartsdul style=display: block;
  li
  a id= onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
  ('1'); href=http://www.winamp.com/music/top-artists/all/today;
  onclick=TopArtist.selectitem(id)World Wide/a
  /li
  li
  a id=arg onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
  ('1'); href=http://www.winamp.com/music/top-artists/argentina;
  onclick=TopArtist.selectitem(id) Argentina /a
  /li
  /ul
 
   $browser.ul(:id, cntList).lis.each{|list_item|
 
 puts list_item.text()
 
  }
  list_item.flash() or $browser.ul(:id, cntList).li(:index, 1).link
  (:text, World Wide).exists?()  both are locating the object but i am
  not able to perform click operation on the links embedded inside li
  tag , could some give me inputs ?
  Thanks in advance
  -Basu
 


--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread basu


Used this, its working now
$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).focus()
$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).fire_event('onClick')

On Jul 21, 11:32 am, kiran yajamanyam kiranyajaman...@gmail.com
wrote:
 Hi Friends,

 Even i face this issue many times for many buttons. But i use mouse_click
 method. Unfortunately, mouse_click is not working fine for firefox browser
 and i have got struck up with this issue and there is no other work around
 for me.

 Is there any solution for this?

 Regards,
 Kinnu

 On Tue, Jul 21, 2009 at 11:53 AM, Basavana Gowda K S 
 bas.go...@gmail.comwrote:

  Hi Ivan,

  That option is also not working

  On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov 
  ikabluch...@gmail.comwrote:

  Try to raise javascript event

  $browser.ul(:id, cntList).li(:index, 1).link(:text, World
  Wide).fire_event('onClick')

  On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
   Hi,
   I have list structure like this,

   ul id=cntList class=chartsdul style=display: block;
   li
   a id= onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
   ('1'); href=http://www.winamp.com/music/top-artists/all/today;
   onclick=TopArtist.selectitem(id)World Wide/a
   /li
   li
   a id=arg onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
   ('1'); href=http://www.winamp.com/music/top-artists/argentina;
   onclick=TopArtist.selectitem(id) Argentina /a
   /li
   /ul

        $browser.ul(:id, cntList).lis.each{|list_item|

              puts list_item.text()

       }
   list_item.flash() or $browser.ul(:id, cntList).li(:index, 1).link
   (:text, World Wide).exists?()  both are locating the object but i am
   not able to perform click operation on the links embedded inside li
   tag , could some give me inputs ?
   Thanks in advance
   -Basu
--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread kiran yajamanyam
Its not working for me in firefox :(

On Tue, Jul 21, 2009 at 12:18 PM, basu bas.go...@gmail.com wrote:



 Used this, its working now
 $browser.ul(:id, cntList).li(:index, 1).link(:text, World
 Wide).focus()
 $browser.ul(:id, cntList).li(:index, 1).link(:text, World
 Wide).fire_event('onClick')

 On Jul 21, 11:32 am, kiran yajamanyam kiranyajaman...@gmail.com
 wrote:
  Hi Friends,
 
  Even i face this issue many times for many buttons. But i use mouse_click
  method. Unfortunately, mouse_click is not working fine for firefox
 browser
  and i have got struck up with this issue and there is no other work
 around
  for me.
 
  Is there any solution for this?
 
  Regards,
  Kinnu
 
  On Tue, Jul 21, 2009 at 11:53 AM, Basavana Gowda K S 
 bas.go...@gmail.comwrote:
 
   Hi Ivan,
 
   That option is also not working
 
   On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov 
 ikabluch...@gmail.comwrote:
 
   Try to raise javascript event
 
   $browser.ul(:id, cntList).li(:index, 1).link(:text, World
   Wide).fire_event('onClick')
 
   On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
Hi,
I have list structure like this,
 
ul id=cntList class=chartsdul style=display: block;
li
a id= onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
('1'); href=http://www.winamp.com/music/top-artists/all/today;
onclick=TopArtist.selectitem(id)World Wide/a
/li
li
a id=arg onmouseout=TopArtist.set('0');
 onmouseover=TopArtist.set
('1'); href=http://www.winamp.com/music/top-artists/argentina;
onclick=TopArtist.selectitem(id) Argentina /a
/li
/ul
 
 $browser.ul(:id, cntList).lis.each{|list_item|
 
   puts list_item.text()
 
}
list_item.flash() or $browser.ul(:id, cntList).li(:index, 1).link
(:text, World Wide).exists?()  both are locating the object but i
 am
not able to perform click operation on the links embedded inside li
tag , could some give me inputs ?
Thanks in advance
-Basu
 


--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread Ivan Kabluchkov

May be use fire_event('onMouseOver') instead of focus() ?

On 21 июл, 11:00, kiran yajamanyam kiranyajaman...@gmail.com wrote:
 Its not working for me in firefox :(

 On Tue, Jul 21, 2009 at 12:18 PM, basu bas.go...@gmail.com wrote:

  Used this, its working now
  $browser.ul(:id, cntList).li(:index, 1).link(:text, World
  Wide).focus()
  $browser.ul(:id, cntList).li(:index, 1).link(:text, World
  Wide).fire_event('onClick')

  On Jul 21, 11:32 am, kiran yajamanyam kiranyajaman...@gmail.com
  wrote:
   Hi Friends,

   Even i face this issue many times for many buttons. But i use mouse_click
   method. Unfortunately, mouse_click is not working fine for firefox
  browser
   and i have got struck up with this issue and there is no other work
  around
   for me.

   Is there any solution for this?

   Regards,
   Kinnu

   On Tue, Jul 21, 2009 at 11:53 AM, Basavana Gowda K S 
  bas.go...@gmail.comwrote:

Hi Ivan,

That option is also not working

On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov 
  ikabluch...@gmail.comwrote:

Try to raise javascript event

$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).fire_event('onClick')

On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
 Hi,
 I have list structure like this,

 ul id=cntList class=chartsdul style=display: block;
 li
 a id= onmouseout=TopArtist.set('0'); onmouseover=TopArtist.set
 ('1'); href=http://www.winamp.com/music/top-artists/all/today;
 onclick=TopArtist.selectitem(id)World Wide/a
 /li
 li
 a id=arg onmouseout=TopArtist.set('0');
  onmouseover=TopArtist.set
 ('1'); href=http://www.winamp.com/music/top-artists/argentina;
 onclick=TopArtist.selectitem(id) Argentina /a
 /li
 /ul

      $browser.ul(:id, cntList).lis.each{|list_item|

            puts list_item.text()

     }
 list_item.flash() or $browser.ul(:id, cntList).li(:index, 1).link
 (:text, World Wide).exists?()  both are locating the object but i
  am
 not able to perform click operation on the links embedded inside li
 tag , could some give me inputs ?
 Thanks in advance
 -Basu
--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread kiran yajamanyam
Tried and tired with all options using fire_event but no luck.
If some one have code for Right click or mouse click (Co-Ordinate basis)
for firefox please send it across that will be very much useful

Regards,
Kinnu

On Tue, Jul 21, 2009 at 12:59 PM, Ivan Kabluchkov ikabluch...@gmail.comwrote:


 May be use fire_event('onMouseOver') instead of focus() ?

 On 21 июл, 11:00, kiran yajamanyam kiranyajaman...@gmail.com wrote:
  Its not working for me in firefox :(
 
  On Tue, Jul 21, 2009 at 12:18 PM, basu bas.go...@gmail.com wrote:
 
   Used this, its working now
   $browser.ul(:id, cntList).li(:index, 1).link(:text, World
   Wide).focus()
   $browser.ul(:id, cntList).li(:index, 1).link(:text, World
   Wide).fire_event('onClick')
 
   On Jul 21, 11:32 am, kiran yajamanyam kiranyajaman...@gmail.com
   wrote:
Hi Friends,
 
Even i face this issue many times for many buttons. But i use
 mouse_click
method. Unfortunately, mouse_click is not working fine for firefox
   browser
and i have got struck up with this issue and there is no other work
   around
for me.
 
Is there any solution for this?
 
Regards,
Kinnu
 
On Tue, Jul 21, 2009 at 11:53 AM, Basavana Gowda K S 
   bas.go...@gmail.comwrote:
 
 Hi Ivan,
 
 That option is also not working
 
 On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov 
   ikabluch...@gmail.comwrote:
 
 Try to raise javascript event
 
 $browser.ul(:id, cntList).li(:index, 1).link(:text, World
 Wide).fire_event('onClick')
 
 On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
  Hi,
  I have list structure like this,
 
  ul id=cntList class=chartsdul style=display: block;
  li
  a id= onmouseout=TopArtist.set('0');
 onmouseover=TopArtist.set
  ('1'); href=http://www.winamp.com/music/top-artists/all/today
 
  onclick=TopArtist.selectitem(id)World Wide/a
  /li
  li
  a id=arg onmouseout=TopArtist.set('0');
   onmouseover=TopArtist.set
  ('1'); href=http://www.winamp.com/music/top-artists/argentina
 
  onclick=TopArtist.selectitem(id) Argentina /a
  /li
  /ul
 
   $browser.ul(:id, cntList).lis.each{|list_item|
 
 puts list_item.text()
 
  }
  list_item.flash() or $browser.ul(:id, cntList).li(:index,
 1).link
  (:text, World Wide).exists?()  both are locating the object
 but i
   am
  not able to perform click operation on the links embedded inside
 li
  tag , could some give me inputs ?
  Thanks in advance
  -Basu
 


--~--~-~--~~~---~--~~
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: click method with list items

2009-07-21 Thread Chuck van der Linden

try it manually from a IRB console session,
Get the element selected in firebug so you can see it's properties
then try firing first the onmouseover event as that is specifically
what the element is set to trigger on.
 have a close look in firebug at how the item was modified by the code
that executes when the event happens.  You might need to be VERY
careful with mouse when doing this so you do not accidentally end up
firing an 'onmouseout' event.

Then based on those properties, try your click.

If that works then try it in the script, but you might need a little
sleep between the two lines of code, to give the client side code time
to execute after you've fired the onmouseover event.

I've seen objects that change their ID's when you mouseover them, and
where the link ONLY works in that condition  so you had to fire
onmouseover against the initial state ID, let the client side
javascript do it's thing, and then execute the click against an
entirely different ID value for the object (created by the
onmouseover)

On Jul 21, 1:09 am, kiran yajamanyam kiranyajaman...@gmail.com
wrote:
 Tried and tired with all options using fire_event but no luck.
 If some one have code for Right click or mouse click (Co-Ordinate basis)
 for firefox please send it across that will be very much useful

 Regards,
 Kinnu

 On Tue, Jul 21, 2009 at 12:59 PM, Ivan Kabluchkov 
 ikabluch...@gmail.comwrote:





  May be use fire_event('onMouseOver') instead of focus() ?

  On 21 июл, 11:00, kiran yajamanyam kiranyajaman...@gmail.com wrote:
   Its not working for me in firefox :(

   On Tue, Jul 21, 2009 at 12:18 PM, basu bas.go...@gmail.com wrote:

Used this, its working now
$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).focus()
$browser.ul(:id, cntList).li(:index, 1).link(:text, World
Wide).fire_event('onClick')

On Jul 21, 11:32 am, kiran yajamanyam kiranyajaman...@gmail.com
wrote:
 Hi Friends,

 Even i face this issue many times for many buttons. But i use
  mouse_click
 method. Unfortunately, mouse_click is not working fine for firefox
browser
 and i have got struck up with this issue and there is no other work
around
 for me.

 Is there any solution for this?

 Regards,
 Kinnu

 On Tue, Jul 21, 2009 at 11:53 AM, Basavana Gowda K S 
bas.go...@gmail.comwrote:

  Hi Ivan,

  That option is also not working

  On Tue, Jul 21, 2009 at 11:48 AM, Ivan Kabluchkov 
ikabluch...@gmail.comwrote:

  Try to raise javascript event

  $browser.ul(:id, cntList).li(:index, 1).link(:text, World
  Wide).fire_event('onClick')

  On 21 июл, 09:59, basu bas.go...@gmail.com wrote:
   Hi,
   I have list structure like this,

   ul id=cntList class=chartsdul style=display: block;
   li
   a id= onmouseout=TopArtist.set('0');
  onmouseover=TopArtist.set
   ('1'); href=http://www.winamp.com/music/top-artists/all/today
  
   onclick=TopArtist.selectitem(id)World Wide/a
   /li
   li
   a id=arg onmouseout=TopArtist.set('0');
onmouseover=TopArtist.set
   ('1'); href=http://www.winamp.com/music/top-artists/argentina
  
   onclick=TopArtist.selectitem(id) Argentina /a
   /li
   /ul

        $browser.ul(:id, cntList).lis.each{|list_item|

              puts list_item.text()

       }
   list_item.flash() or $browser.ul(:id, cntList).li(:index,
  1).link
   (:text, World Wide).exists?()  both are locating the object
  but i
am
   not able to perform click operation on the links embedded inside
  li
   tag , could some give me inputs ?
   Thanks in advance
   -Basu- Hide quoted text -

 - Show quoted 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: click method with list items

2009-07-21 Thread Chuck van der Linden

A few other notes:

If you are in fact trying to automate the page this code appears to
come from (the winamp music page) then you need to be aware of a few
things that are going to cause you challenges when automating this
page.
 1) those 'lists' are not anything of the sort.  They are not HTML
Select tags (a normal HTML list box control), they are a series of
links that are manipulated by client side javascript to cause them to
appear and disappear, and LOOK to the end user like a selection list.
So you are dealign with a lot of client side javascript shennagins
going on that sort of abuses one kind of element in order to take the
appearance of a different kind of element.
 2) The same controls exist in multiple places on the page, and are
repeated nearly verbatum, (including non-distinct ID values) in more
than one place in the page source. So you are going to have challenges
making sure that water knows WHICH one of those things you are
actually trying to manipulate, among the multiple indentical copies
found on the page.

This means a few things
 1) you should avoid using ID as an identifier for those elements
since the ID values on the page are not Unique, and Watir generally
presumes pages are valid HTML and do not repeat the ID tags (which is
part of the HTML spec).  Using the ID attribute to identify any
element on a page where the ID values are not unique is pretty much
(IMHO anyway) unsupported and is surely unpredictable.
 2) since all the other attributes of the items are ALSO repeated
(which IS valid HTML, only ID's are supposed to be unique), you are
going to have to do one of two things to get the code to act on the
'proper' version of the link
  a) use multiple attributes one of which is index, and know the right
index for each item.
  b) refer to the elements by first specifying an unique outer-
container, within which the element's attributes are unique
 (note I prefer approach b, because you never know when someone re-
organizes the page and now all your index values are wrong)
3) Due to the large amount of javascript you may need to fire events
such as 'onmouseover', keeping item 2 in mind, before trying to click
on the link in order to 'activate' it or somesuch.

For example, the 'chartsCntry' div, which contains the country list
stuff, exists within both the mainCarttists and mainCsongs divs.   So
to click and expand the list under artist, (as opposed to under Song)
you may have to click (or fire the onclick event) first on the little
link that looks like a button, which expands the list and causes those
country links to become visible. You may also have to allow some small
amount of sleep time to let the client side code do it's thing, this
may take experimentation.   I recommend working things first from a
ruby IRB session, to be sure you have the right commands, that work if
not performed at machine speed.  Then try it in a script and add/
remove sleeps as needed to get things to run reliably.  This might end
up looking a bit like this (note I have NOT tested this)

browser.div(:class,'mainCartists').link(:class, 'dnBtn').fire_event
('onMouseover')
browser.div(:class,'mainCartists').link(:class, 'dnBtn').click
sleep 1
browser.div(:class,'mainCartists').link(:text, 'Argentina').fire_event
('onMouseover')
browser.div(:class,'mainCartists').link(:text, 'Argentina').click


Good luck.



On Jul 21, 11:06 am, Chuck van der Linden sqa...@gmail.com wrote:
 try it manually from a IRB console session,
 Get the element selected in firebug so you can see it's properties
 then try firing first the onmouseover event as that is specifically
 what the element is set to trigger on.
  have a close look in firebug at how the item was modified by the code
 that executes when the event happens.  You might need to be VERY
 careful with mouse when doing this so you do not accidentally end up
 firing an 'onmouseout' event.

 Then based on those properties, try your click.

 If that works then try it in the script, but you might need a little
 sleep between the two lines of code, to give the client side code time
 to execute after you've fired the onmouseover event.

 I've seen objects that change their ID's when you mouseover them, and
 where the link ONLY works in that condition  so you had to fire
 onmouseover against the initial state ID, let the client side
 javascript do it's thing, and then execute the click against an
 entirely different ID value for the object (created by the
 onmouseover)

 On Jul 21, 1:09 am, kiran yajamanyam kiranyajaman...@gmail.com
 wrote:



  Tried and tired with all options using fire_event but no luck.
  If some one have code for Right click or mouse click (Co-Ordinate basis)
  for firefox please send it across that will be very much useful

  Regards,
  Kinnu

  On Tue, Jul 21, 2009 at 12:59 PM, Ivan Kabluchkov 
  ikabluch...@gmail.comwrote:

   May be use fire_event('onMouseOver') instead of focus() ?

   On 21 июл, 11:00, kiran yajamanyam kiranyajaman...@gmail.com