单击Selenium Webdriver中的javascript div链接 [英] click on javascript div link in selenium webdriver

查看:91
本文介绍了单击Selenium Webdriver中的javascript div链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<td class="menubox22" colspan="2">
   <table cellpadding=0 cellspacing=0 border=0 class="mybox1">
      <tr>
         <td id="tdMenuBar" class="mybox1">
            <table id="tblMenuBar" border="0" cellspacing=0 cellpadding=0>
               <tr id="mytr">
                  <td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu1,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
                     &nbsp;Alerts&nbsp;
                  </td>
                  <td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu2,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
                     &nbsp;Inventory&nbsp;
                  </td>
                  <td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu3,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
                     &nbsp;RTAM Exclusion&nbsp;
                  </td>
                  <td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu4,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
                     &nbsp;Sales Order&nbsp;
                  </td>
                  <div id="divMenu20110329014658433878" name="actiondiv" style="visibility:hidden;position:absolute;border:">
                     <DIV myonclick="window.parent.location.href='/smcfs/console/order.search';">
                        Sales Order Console
                     </DIV>
                     <DIV myonclick="window.parent.location.href='/smcfs/console/shipment.search';">
                        Outbound Shipment Console
                     </DIV>
                  </div>

我试图点击表格行中的销售订单控制台.我尝试使用xpath://*[@id='divMenu4']/div[1]进行访问,一旦单击销售订单"链接,该链接就会可见,但是我无法访问它.

I am trying to click on Sales Order Console which is in the table row. I tried to access with xpath://*[@id='divMenu4']/div[1], which will be visible once I click on the Sales Order link, but I cannot access it.

推荐答案

请在Xpath下尝试:-

Please try below Xpath:-

//td[@id='PanelTable'][4]

或更具体

//td[@id='PanelTable' and contains(text(),'Sales Order')]

如果仍然遇到任何问题,请与我联系:)

Please get back to me if still facing any issue :)

这篇关于单击Selenium Webdriver中的javascript div链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆