Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:38:35+00:00 2026-05-26T14:38:35+00:00

I am trying to trigger a mouse over drop down window in Watir on

  • 0

I am trying to trigger a mouse over drop down window in Watir on ruby.

I have tried it using both of the two scripts below, so far neither have worked.:

$browser.div(:class => "rolloverMAINMenu").fire_event("onMouseOver")

and

$browser.a(:style=>"background-color:cccccc;width:200px;").fire_event("onMouseOver")

HTML:

<font COLOR="green">
<a style="background-color:cccccc;width:200px;" onmouseover="rolloverMenu(1, 'mainMenu');" onmouseout="rolloverMenu(0, 'mainMenu');"
onclick="rolloverMenu(0, 'mainMenu');">
&nbsp;&nbsp;<B> Roll Over Menu </B></a>

 <div style="background-color:cccccc;width:200px;" class="rolloverMAINMenu"   id="mainMenu"    style="display: none;" onmouseover="rolloverMenu(1, 'mainMenu');"`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:38:35+00:00Added an answer on May 26, 2026 at 2:38 pm

    For the div, since it has an ID, I’d recommend using that to identify it since ID values should (according to the HTML spec) should be unique on the page. That will insure you are selecting the correct element.

    Secondly since the code is looking for ‘onmouseover’ I would specify the event that way and not use camelCase

    browser.div(:id, 'mainMenu').fire_event('onmouseover')
    

    For the link, the problem you are having is identifying it. I do not see :style listed as an option for identifying elements (although potentially that doc could be out of date) I might suggest using the text or some other aspect, or you may need to resort to xpath.

    browser.link(:text, /Roll Over Menu/).fire_event('onmouseover')
    

    Or since the link is set to react to click, you could try that also

    browser.link(:text, /Roll Over Menu/).click 
    

    If you are placing these in a script, since the client is executing javascript methods in response to the events, you may need to have a small pause in the script at that point to allow for the DOM to be updated, before you try to interact with any elements rendered to the screen in response to the mouseover or click

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build drop down options on mouse over and on click. The
I'm trying to get fancybox to trigger when the mouse is hovered over a
I am trying to trigger the onScroll event this way using prototype: Event.observe(document, 'scroll',
I'm trying to set up a pretty basic hover animation in jQuery. Mouse over
I am trying to call a command when my mouse is over a toggle
here's the page , I'm trying to delay the drop-down menu so the user
I'm trying to build a web app using Dojo. I have a form that
I am trying to trigger the running of a shell script using PHP. Essentially,
I am basically trying to trigger a function if the footer is inside the
I'm trying to trigger a signal when a double click happens in one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.