How can I automate clicking on a web page drop down list?

I am new to automating testing of web pages using Rubymine/Ruby/Cucumber and would like to be able to automate in a scenario/step definition the clicking of an option from a  drop down menu. I am able to do this sufficiently with a select list in the page definition when the HTML for the drop down box is set up between SELECT tags (with an ID or CLASS identifier given) but I am unable to figure out how to do this when the HTML for the drop down box is an anchor tag as follows:


<li >


<a href="/index.php/products/intelligent_id_overview.html">Intelligent Overview</a>


</li>


On the actual web page as a user, you have to hover over the drop down box, then it gives a list of options underneath to click on.


I am trying to figure out how to automate clicking on one of those options that drop down. I have attached a screenshot of the site and drop down box.


Hope I sufficiently explained the problem. Any help is appreciated!


Thanks!



Attachment(s):
IID drop down.jpg
2 comments
Comment actions Permalink

You could use one of JavaScript test engine like Webrat.

Just mark feature or scenario with @javascript tag.

 
@javascript
Feature: Hover menu list
  Scenario: Hover menu item
    When I hover menu "Products"
    And I choose "Product tutor" in menu list
    Then should be redirect to "Product tutor" page
0

Please sign in to leave a comment.