0
我試圖選擇樹節點中的某些項目。理想情況下,我想做以下事情:Selenium Webdriver - 在樹節點中選擇一個項目
1)根據項目的文本從樹視圖中選擇「Child Item One」。
這裏是樹對象的HTML:
<div id="form:treeSingle" class="ui-tree ui-widget ui-widget-content ui-corner-all
treeMenu" aria-multiselectable="true" role="tree">
<ul class="ui-tree-container">
<li id="form:treeSingle:0" class="ui-treenode ui-treenode-parent ui-treenode-
unselected" role="treeitem" data-nodetype="default" data-rowkey="0">
<span class="ui-treenode-content ui-tree-selectable" aria-selected="false"
aria-expanded="true">
<span class="ui-tree-toggler ui-icon ui-icon-triangle-1-s"/>
<span/>
<span class="ui-treenode-label ui-corner-all ui-state-hover">Top Level
Perm</span>
</span>
<ul class="ui-treenode-children">
<li id="form:treeSingle:0_0" class="ui-treenode ui-treenode-parent
ui-treenode-selected" role="treeitem" data-
nodetype="default" data-rowkey="0_0">
<span class="ui-treenode-content ui-tree-selectable" aria-
selected="true" aria-expanded="true">
<span class="ui-tree-toggler ui-icon ui-icon-triangle-1-s"/>
<span/>
<span class="ui-treenode-label ui-corner-all ui-state-
highlight">Child Item One</span>
</span>
任何幫助理解。
對不起......不可見的例子。我已編輯請求以僅顯示選擇一個子節點的示例。謝謝! – zerotres