无法使用Selenium(Perl)单击弹出菜单

时间:2017-06-05 14:49:47

标签: javascript perl selenium

我有以下HTML,我试图点击最后一项“报告管理”。我尝试了很多东西,但我无法做到。

<td class="appOptionsContainer"><div id="goto_span" style="position:relative; z-index:12"><div class="bannerOptionsButtonNormal" role="button" aria-haspopup="true" tabindex="0" onmouseover="this.className='bannerOptionsButtonOver';" onmouseout="this.className='bannerOptionsButtonNormal';" onkeypress="return CCPopupMenu.dropDown(event,0,0,'goto');" onclick="return CCPopupMenu.dropDown(event,0,0,'goto');" title="Launch Options"><table cellspacing="0" cellpadding="0" class="bannerOptions" role="presentation"><tr><td nowrap style="padding-left:4px;"><a tabindex="-1">Launch</a></td><td style="padding-right:4px;padding-left:4px;"><img name="toolsMenu_imgFlyControl" src="/ibmcognos/skins/corporate/shared/images/dropdown_arrow_banner.gif" title="Launch Options" alt="Launch Options"></td></tr></table></div></div><script language="javascript">
var ccPopupMessageStrings = eval("({ 'IDS_CCPOPUP_DOT':'Dot' , 'IDS_CCPOPUP_CHECKED':'Checked' } )");
with(new CCPopupMenu("goto","goto_span", "","", ccPopupMessageStrings))
{

    setLabel("Launch menu");

    addMenuItem("icd","", "Cognos Workspace", "/ibmcognos/skins/corporate/branding/tools_dashboard.gif","launchApp(\'IBMCognosDashboard\')");

    addMenuItem("ice","", "Cognos Workspace Advanced", "/ibmcognos/skins/corporate/branding/tools_report_studio_bua.gif","launchApp(\'IBMBusinessInsight\')");

    addMenuItem("qs","", "Query Studio", "/ibmcognos/skins/corporate/branding/tools_query_studio.gif","launchApp(\'QueryStudio\')");

    addMenuItem("rspro","", "Report Studio", "/ibmcognos/skins/corporate/branding/tools_report_studio.gif","launchApp(\'ReportStudioPro\')");

    addMenuItem("dt","", "Drill-through Definitions", "/ibmcognos/skins/corporate/branding/tools_drill_through.gif","launchApp(\'DrillThrough\')");

    addMenuSeparator();

    addMenuItem("ac","", "Reporting Administration", "/ibmcognos/skins/corporate/branding/tools_cognos_administration.gif","launchApp(\'Administration\')");

}
</script></td>

使用 - Selenium远程驱动程序1.20 硒3.4.0 RHEL 5.5 Perl 5.20.1

我使用perl编写测试用例。

我是Selenium的新手,任何帮助表示赞赏。 TIA!

在查看HTML并检查元素后,我能够突出显示单元格,但我无法点击它。

这是我在代码中使用的内容 -

$driver->find_element_by_link_text("Launch")->click();
$driver->find_element_by_class_name("appOptionsContainer");
$driver->find_element_by_id("acmenuItemTR")->click();

这是快照 - Link highlighted

这是我inspect the element -

时得到的结果

0 个答案:

没有答案