0
votes

I need to navigate frames by clicking this drop-down list using selenium. I need to select the links on the menu and drop-down list. But selenium.click doesn't work.

on manual execution: Mouse-Over The SUBSCRIBER link/menu for list to dropped down Click the selected link/menu from the drop-down list

I need to automate it through Selenium.

Here is the element inspector from firebug:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
      <!-- Generated by Python html module ($Revision: 1.6 $). -->

      <!-- charset : iso-8859-1 -->
    <head> … </head>
<frameset rows="78,62,32,*" frameborder="no" border="0">
    <frame scrolling="no" src="/html/header_frame.html" noresize="1" name="head_frame"></frame>
    <frame scrolling="no" src="/cgi-bin/main/title.cgi" noresize="1" name="titleframec"></frame>
    <frame scrolling="no" src="/cgi-bin/main/navigationframe.cgi" noresize="1" name="navFrame">#document<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
      <!-- Generated by Python html module ($Revision: 1.6 $). -->

      <!-- charset : iso-8859-1 -->
    <head> … </head>
    <body class="nav_frame" marginwidth="0" marginheight="0" onload="parent.bodyframe.location='/cgi-bin/service/subscriber/subscriberDetails.cgi';" topmargin="0" leftmargin="0"><script language="JavaScript"> … </script>
    <table class="nav_frame" cellspacing="0" cellpadding="0" border="0">
        <tbody>
        <tr>
            <td> … </td>
            <td><a onmouseout="MM_startTimeout();" onmouseover="MM_showMenu(menu_SUBS,0,0,null,'subscriber_bt');" href="javascript:;"><img width="125" height="32" border="0" alt="" src="/nav_images/subscriber_bt.jpg" name="subscriber_bt"></img></a></td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
            <td> … </td>
       </tr>
       </tbody>
    </table>
    <script language="JavaScript"> … </script>
    <form name="navig" target="bodyframe" method="POST" action="/cgi-bin/service/subscriber/subscriberDetails.cgi"> … </form>
    </body>
    </html>
</frame>
<frame name="bodyframe">
</frame>
</frameset><noframes> … </noframes>
</html>

actual drop-down list

1

1 Answers

1
votes

You'd need to use the Actions() class of Webdriver.

Actions action = new Actions(driver);
actions.moveToElement(driver.findElement(By.id("subscriber_element"))).moveToElement(driver.findElement(By.id("revealed_element"))).click().build().perform();