51Testing软件测试论坛

标题: 求助webdriver比较有难度的问题 [打印本页]

作者: tianya6607    时间: 2014-9-19 08:58
标题: 求助webdriver比较有难度的问题
在学习webdriver过程中,用testlink做实验,在选择某个测试项目后,点击用例(如附图所示),用例不能用元素识别的方法来识别,目前想要对用例实现拖拽到对应的测试组件,请问如何解决?
作者: Linda0721    时间: 2014-9-19 14:00
楼主用firebug 看看是什么元素,再决定如何处理
作者: tianya6607    时间: 2014-9-19 14:36
firedebug抓到如下:
<div id="tree_div" class=" x-panel x-tree" style="overflow:auto; height:100%;border:1px solid #c3daf9;">
<div id="ext-gen13" class="x-panel-bwrap">
<div id="ext-gen14" class="x-panel-body x-panel-body-noheader" style="overflow: auto;">
<ul id="ext-gen15" class="x-tree-root-ct x-tree-arrows">
<li class="x-tree-node">
<div id="extdd-1" class="x-tree-node-el x-unselectable x-tree-node-expanded" unselectable="on" ext:tree-node-id="868603">
<span class="x-tree-node-indent"></span>
<img class="x-tree-ec-icon x-tree-elbow-end-minus" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<img id="extdd-2" class="x-tree-node-icon" unselectable="on" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<a class="x-tree-node-anchor" tabindex="1" href="javascript:EP(868603)" hidefocus="on">
<span id="extdd-3" unselectable="on">JasonTian (423)</span>
</a>
</div>
<ul id="ext-gen19" class="x-tree-node-ct" style="visibility: visible; position: static; left: auto; top: auto; z-index: auto;">
<li class="x-tree-node">
<div id="extdd-4" class="x-tree-node-el x-unselectable folder x-tree-node-expanded" unselectable="on" ext:tree-node-id="1031725">
<span class="x-tree-node-indent">
<img class="x-tree-icon" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
</span>
<img class="x-tree-ec-icon x-tree-elbow-minus" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<img id="extdd-5" class="x-tree-node-icon" unselectable="on" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<a class="x-tree-node-anchor" tabindex="1" href="javascript:ETS(1031725)" hidefocus="on">
<span id="extdd-6" unselectable="on">SuiteA (7)</span>
</a>
</div>
<ul id="ext-gen22" class="x-tree-node-ct" style="visibility: visible; position: static; left: auto; top: auto; z-index: auto;">
<li class="x-tree-node">
<div id="extdd-10" class="x-tree-node-el x-unselectable folder x-tree-node-expanded x-tree-selected" unselectable="on" ext:tree-node-id="933691">
<span class="x-tree-node-indent">
<img class="x-tree-ec-icon x-tree-elbow-minus" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<img id="extdd-11" class="x-tree-node-icon" unselectable="on" src="http://192.168.33.3/testlink/third_party/ext-js/images/default/s.gif" alt="">
<a class="x-tree-node-anchor" tabindex="1" href="javascript:ETS(933691)" hidefocus="on">
<span id="extdd-12" unselectable="on">Jason (3)</span>
</a>
</div>
<ul id="ext-gen24" class="x-tree-node-ct" style="visibility: visible; position: static; left: auto; top: auto; z-index: auto;">
作者: joykao    时间: 2014-9-20 13:04
不能用元素识别的方式识别是个什么意思?通过元素的属性然后没找到元素,是多frame吗?
拖拽是可以实现的,但是你得先找到元素啊。。
  Actions builder = new Actions(driver);
builder.dragAndDrop(source, target).perform();




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2