public void hover ( final Object ... expected ) { dispatcher . beforeHover ( this , expected ) ; new Actions ( Grid . driver ( ) ) . moveToElement ( getElement ( ) ) . perform ( ) ; try { for ( Object expect : expected ) { if ( expect instanceof AbstractElement ) { AbstractElement a = ( AbstractElement ) expect ; WebDriverWaitUtils . waitUntilElementIsVisible ( a . getLocator ( ) ) ; } else if ( expect instanceof String ) { String s = ( String ) expect ; WebDriverWaitUtils . waitUntilElementIsVisible ( s ) ; } } } finally { processScreenShot ( ) ; dispatcher . afterHover ( this , expected ) ; } }
Moves the mouse pointer to the middle of the element . And waits for the expected elements to be visible .