我有以下代码:
<div id="filebrowser" class="jstree jstree-1 jstree-grid-cell jstree-default jstree-checkbox-selection" role="tree" aria-multiselectable="true" tabindex="0" aria-activedescendant="-3" aria-busy="false" aria-selected="false">
<ul class="jstree-container-ul jstree-children" role="group">
<li role="treeitem" aria-selected="false" aria-level="1" aria-labelledby="-3_anchor" aria-expanded="false" id="-3" class="jstree-node jstree-last jstree-closed" aria-busy="false">
<i class="jstree-icon jstree-ocl" role="presentation"></i>
<a class="jstree-anchor jstree-grid-col-0" href="#" tabindex="-1" id="-3_anchor" title="/">
<i class="jstree-icon jstree-checkbox" role="presentation"></i>
<i class="jstree-icon jstree-themeicon glyphicon glyphicon-folder-close jstree-themeicon-custom" role="presentation"></i>/
</a>
</li>
</ul>
</div>
对于我的硒测试,我需要点击屏幕截图中标记为红色的<i class="jstree-icon jstree-ocl">
。我想在列表中单击这个,它也有一个<a>
元素,它有一个title= attribute
。有可能吗?你知道吗
作为背景:我想在给定的jstree中选择不同的文件,并通过将它们的名称设置为全局值来指向这些文件。如果我想选择"/"
、"etc/"
、"testdirectory"
然后"test_file.txt"
。你知道吗
要单击表示为
<i class="jstree-icon jstree-ocl">
的WebElement
,可以使用以下代码行:但是查看
HTML
似乎我们必须调用<a>
标记上的click()
方法,如下所示:相关问题 更多 >
编程相关推荐