0
你能幫我弄清楚如何在Java中使用selenium webdriver定位「新」嗎?如何找到selenium webdriver中的下列對象[ul,li]?
代碼段:
<ul class="ms-crm-CommandBar-Menu">
<li tabindex="-1" class="ms-crm-CommandBarItem ms-crm-CommandBar-Menu ms-crm-CommandBar-Button" title="New Create a new Account record." id="account|NoRelationship|HomePageGrid|Mscrm.HomepageGrid.account.NewRecord" command="account|NoRelationship|HomePageGrid|Mscrm.NewRecordFromGrid" style="white-space: pre-line; display: inline-block;"><span tabindex="-1" class="ms-crm-CommandBar-Button ms-crm-Menu-Label" style="max-width:200px"><a tabindex="0" class="ms-crm-Menu-Label" onclick="return false"><img tabindex="-1" class="ms-crm-ImageStrip-New_16 ms-crm-commandbar-image16by16" src="/_imgs/imagestrips/transparent_spacer.gif" style="vertical-align:top" alt="New"> <span tabindex="-1" class="ms-crm-CommandBar-Menu" style="max-width:150px" command="account|NoRelationship|HomePageGrid|Mscrm.NewRecordFromGrid"> New </span> </a> </span> </li>
我用點擊操作提前給你的命令,但它不是點擊。所以驅動程序能夠找到元素,這是成功的!但是那麼我們可能需要玩某些ul和/或li?請指教。 – rjt
你能發佈一個鏈接到完整的HTML頁面,並顯示你的代碼? – FDM
這是一個隱藏的元素。我如何繼續? – rjt