!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: Hover() or mouseOver simulation  (Read 5578 times)

D.Mamanakis

  • Web User
Hover() or mouseOver simulation
« on: April 10, 2012, 11:30:45 PM »
I have looked through several posts and we have the mouseEvents returning:
 Unrecognized command: POST
 /session/47f5b724-b56c-4ccd-8dcf-e876cfbad665/moveto
 
hover() has been deprecated.
 
What is left?
 
I need to be able to "move the mouse" to a specific element and hold it
 there to activate a "hover event"...
 
I have tried a couple different solutions, but nothing has worked...
 
Anyone have something working?

Jason

  • Web User
Re: Hover() or mouseOver simulation
« Reply #1 on: April 10, 2012, 11:31:05 PM »
What browser are you testing against?

Norman Chin

  • Web User
Re: Hover() or mouseOver simulation
« Reply #2 on: April 10, 2012, 11:31:19 PM »
Read this:
 
http://groups.google.com/group/webdriver/browse_thread/thread/80b36c5...
 
It works on IE.
 

- Show quoted text -

Selenium Webdriver

Re: Hover() or mouseOver simulation
« Reply #2 on: April 10, 2012, 11:31:19 PM »

doridori Jo

  • Web User
Re: Hover() or mouseOver simulation
« Reply #3 on: April 10, 2012, 11:31:34 PM »
is it possible to get this working in firefoxdriver?
 
I agree, most javascript based web applications for example on
 mouseover(hover) the menu item, submenus are expanded....hover() is an
 absolute must....
 
I am not sure how to approach that latter situation....A user would hover
 their mouse cursor over a certain position or certain element, and how would
 you decide when to fire the hoverhasoccured event?
 
This is a must have event.....
 

- Show quoted text -

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #4 on: April 10, 2012, 11:31:50 PM »
How about RemoteDriver?  I can't get moveto events working *at all*
 over that; I tried a variety of methods, including one based on that
 link, in the Ruby Selenium-WebDriver binding, like so:
 e...@driver.find_element(:xpath, "//span[text()='IL-4']")
 @driver.action.move_to(e, 0, 0).perform;
 
and from the server I get this:
 
12:02:41.240 INFO - Executing: [mousemove: 291 false] at URL: /session/
 1304794298927/moveto)
 12:02:41.254 WARN - Exception thrown
 java.lang.UnsupportedOperationException: Unrecognized command: POST /
 session/778b8e46-7252-4f63
 -a488-8258a557293d/moveto
         at
 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
 Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at
 org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
 131)
         at
 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
 105)
         at
 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
 409)
         at org.openqa.selenium.remote.RemoteWebDriver
 $RemoteMouse.mouseMove(RemoteWebDriver.java:701)
         at
 org.openqa.selenium.support.events.internal.EventFiringMouse.mouseMove(EventFiringMouse.java:
 43)
         at
 org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call(MouseMoveToLocation.java:
 61)
         at
 org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call(MouseMoveToLocation.java:
 1)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
 Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor
 $Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
 Source)
         at java.lang.Thread.run(Unknown Source)
 12:02:41.259 WARN - Exception: Unrecognized command: POST /session/
 778b8e46-7252
 -4f63-a488-8258a557293d/moveto
 
With no means of triggering the javascript "mouseOver" event, there
 are huge amounts of websites that can't actually be tested with
 Selenium-WebDriver at all.  Especially since the dragElement action,
 which does "work", doesn't seem to trigger that event either.  With
 Selenium 1.0, I'd just use mouse_over and then do the dragging, but I
 see no way to do that with Selenium-WebDriver.
 
I'm more than happy to contribute code to fix this, or help in any
 other way I can, but I'd really need some pointers as I've almost no
 java experience and certainly none with direct web browser
 manipulation.
 
As it is, though, I'm rather stuck: there's an element of the site I'm
 testing that I simply cannot interact with with 2.0b3 (and other
 things that don't work in the 1.0 branch; see
 http://groups.google.com/group/selenium-users/browse_frm/thread/c0284...
 if you care).
 
Thanks for any assistance.
 
-Robin
 
On May 6, 6:59 pm, doridori Jo <dorik...@gmail.com> wrote:
 

- Show quoted text -

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #5 on: April 10, 2012, 11:32:06 PM »
On May 6, 6:05 pm, Norman Chin <norman.c...@gmail.com> wrote:
 
> Read this:
 > http://groups.google.com/group/webdriver/browse_thread/thread/80b36c5...
 
> It works on IE.
 


Can you explain how?  Like the original poster, I'm using the
 RemoteDriver and the moveto event is simply rejected by 2.0b3.
 Assuming you're using the remote driver, can you show us what events
 this generates in the server output?
 As far as I can tell, the Java bindings work the same way:
 
        // Interactions-related commands.
         .put(CLICK, post("/session/:sessionId/click"))
         .put(DOUBLE_CLICK, post("/session/:sessionId/doubleclick"))
         .put(MOUSE_DOWN, post("/session/:sessionId/buttondown"))
         .put(MOUSE_UP, post("/session/:sessionId/buttonup"))
         .put(MOVE_TO, post("/session/:sessionId/moveto"))
         .put(SEND_MODIFIER_KEY_TO_ACTIVE_ELEMENT, post("/
 session/:sessionId/modifier"))
 
(that's from org/openqa/selenium/remote/HttpCommandExecutor.java ) and
 moveto and buttondown give the same "Unrecognized command: POST /
 session/778b8e46-7252-4f63-a488-8258a557293d/moveto" sort of error.
 
So I'm really confused/curious as to how you're making this work.
 Help us please!
 
-Robin

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #6 on: April 10, 2012, 11:32:23 PM »
On May 6, 6:05 pm, Norman Chin <norman.c...@gmail.com> wrote:
 
> Read this:
 > http://groups.google.com/group/webdriver/browse_thread/thread/80b36c5...
 
> It works on IE.
 


(I'm still being moderated, so my apologies if this shows up in the
 wrong order.)
 Because the server's POST response, which includes an exception from
 the server, is what says "Unrecognized command", I and the original
 poster assumed it was a problem in the server.  Not so, it turns out.
 I went source diving, and "Unrecognized command" is a string that
 *only* appears in the FireFox javascript web driver (specifically,
 trunk/javascript/firefox-driver/extension/components/dispatcher.js
 from the svn repo per http://code.google.com/p/selenium/wiki/CheckOut
 ).
 
The frustrating part is that it the code *does* seem to implement
 moveto, although it does not appear to implement buttondown....  Aaah,
 but that's trunk; the code in 2.0b3 for firefox does *not* implement
 moveto at all.
 
So, two questions:
 
1.  Are there nightly builds somewhere or something?  Compiling java
 is something I'm really badly equipped for.
 
2.  Does anyone know an easy way to *just* change the firefox
 javascript, without having to recompile the whole entire server?
 
Thanks.
 
-Robin

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #7 on: April 10, 2012, 11:32:40 PM »
On May 6, 10:33 am, Jason <jmle...@gmail.com> wrote:
 
> What browser are you testing against?
 

FireFox, but it's all through the selenium-server-standalone-2.0b3.jar
 and the remote driver, so I don't know how much it matters?  (I mean
 that literally: I don't know; maybe a lot).
 -Robin

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #8 on: April 10, 2012, 11:32:58 PM »
On May 6, 6:59 pm, doridori Jo <dorik...@gmail.com> wrote:
 
> is it possible to get this working in firefoxdriver?
 

If you spend all weekend working on it (20+ hours), yes!  :)
 Fortunately for you, I've packaged it up.  See my next post.
 
-Robin

D.Mamanakis

  • Web User
Re: Hover() or mouseOver simulation
« Reply #9 on: April 10, 2012, 11:33:17 PM »
I am glad this has generated a discussion, as it seems others are
 having the same issues.
 I am using FireFox also, and await Robin's solution.
 
Thanks!
 
On May 6, 11:33 am, Jason <jmle...@gmail.com> wrote:
 

- Show quoted text -

Robin Lee Powell

  • Web User
Re: Hover() or mouseOver simulation
« Reply #10 on: April 10, 2012, 11:33:35 PM »
It's already posted; http://groups.google.com/group/webdriver/browse_frm/thread/99d6b31735...
 -Robin
 
On May 9, 3:16 pm, "D.Mamanakis" <dave.mamana...@gmail.com> wrote:
 

- Show quoted text -

Eran M.

  • Web User
Re: Hover() or mouseOver simulation
« Reply #11 on: April 10, 2012, 11:33:55 PM »
Hi,
 
Support for moveto in the Firefox driver has ben submitted in
 r12032<http://code.google.com/p/selenium/source/detail?r=12032> and
 will be included in the next release. I expect to commit support for mouse
 down/up and click in the next few days - most of it is working, there's one
 issue with elements outside of the viewport. Once that's solved, it can be
 committed.
 
Eran
 
On Tue, May 10, 2011 at 5:56 AM, Robin Lee Powell <
 

- Show quoted text -

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
1542 Views
Last post February 21, 2012, 01:58:58 PM
by Ana Stavreva
4 Replies
3366 Views
Last post October 05, 2012, 12:04:31 PM
by adityakumar
4 Replies
2259 Views
Last post April 01, 2012, 06:44:06 PM
by Mark Collin
4 Replies
1163 Views
Last post April 04, 2012, 04:12:11 PM
by Jeff
5 Replies
2414 Views
Last post October 05, 2012, 12:04:10 PM
by adityakumar
2 Replies
1699 Views
Last post April 15, 2012, 05:08:53 PM
by Mike Riley
0 Replies
713 Views
Last post April 02, 2013, 09:15:48 AM
by bouchehda