Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion mouseOver and the :hover CSS rules
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon Stewart  
View profile   Translate to Translated (View Original)
 More options Jun 6 2010, 8:17 pm
From: Simon Stewart <simon.m.stew...@gmail.com>
Date: Sun, 6 Jun 2010 17:17:49 -0700
Local: Sun, Jun 6 2010 8:17 pm
Subject: Re: [selenium-developers] mouseOver and the :hover CSS rules
If you're using native events (that is, you're on Windows) and you're
using the Selenium WebDriver API, then this can be done like so:

((RenderedWebElement) element).hover();

Regards,

Simon

On Wed, May 26, 2010 at 3:44 AM, Sascha <saschaschwa...@yahoo.de> wrote:
> Hi,

> I have been required to verify that the things done onmouseover are
> correctly done in our GUI. These are visual things that are defined in
> CSS using :hover.

> Selenium (I am using the Core based way via RC) has a method mouseOver
> that does fire a mouseover event but does not get the :hover rule
> active. Others also ran into this problem:
> - http://groups.google.com/group/selenium-users/browse_thread/thread/a6...
> - http://groups.google.com/group/selenium-users/browse_thread/thread/85...

> I am having here an implementation that would support this, but only
> for Firefox Chrome (I am using this on FF3/3.5/3.6). I know that there
> are other calls that do not work (the same) on different browsers. I
> have not yet opened an issue for that as I would first like to here
> your opinions on such browser specific implementations.

> Here is what I am doing:

> /**
>  * Overwrites the original mouse out function and additionally
> deactivates the pseudo class :hover in Firefox Chrome
>  *
>  * @param {String} locator an element locator
>  */
> Selenium.prototype.doMouseOut = function(locator) {
>        var element = this.browserbot.findElement(locator);
>        this.browserbot.triggerMouseEvent(element, 'mouseout', true);
>        if(browserVersion.isChrome) {
>                var domUtils = Components.classes["@mozilla.org/inspector/dom-utils;
> 1"].getService(Components.interfaces.inIDOMUtils);
>                // check if :hover is currently active
>                if(0x04 & domUtils.getContentState(element)) {
>                        domUtils.setContentState(element.ownerDocument.documentElement,
> 0x04);
>                }
>        }
> };

> /**
>  * Overwrites the original mouse over function and additionally
> activates the pseude class :hover in Firefox Chrome
>  *
>  * @param {String} locator an element locator
>  */
> Selenium.prototype.doMouseOver = function(locator) {
>        var element = this.browserbot.findElement(locator);
>        this.browserbot.triggerMouseEvent(element, 'mouseover', true);
>        if(browserVersion.isChrome) {
>                // set the :hover to active
>                var domUtils = Components.classes["@mozilla.org/inspector/dom-utils;
> 1"].getService(Components.interfaces.inIDOMUtils);
>                domUtils.setContentState(element, 0x04);
>        }
> };

> --
> You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
> To post to this group, send email to selenium-developers@googlegroups.com.
> To unsubscribe from this group, send email to selenium-developers+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.