0 0

Selenium webDriver拖拽问题,大神些进来帮我看看5

拖拽前:
<tr id="t1">
      <td id="layoutCol0_0" class="colBox" align="center" colspan="2">
                     <div class="colTitle">Wide Display Area</div>
                     <div class="targetMarker"></div>
      </td>
</tr>

<tr id="t2">
       <td id="layoutCol1_0" class="colBox" align="center" colspan="1">
               <div class="colTitle">Narrow Display Area</div>
               <div class="targetMarker"></div>
              <div class="dragBox dragBoxCaption dragBoxTable" style="left: 0px; top: 0px;">System               Information</div>
             <div class="targetMarker"></div>
     </td>
</tr>


拖拽后要达到的效果是这样的:
<tr id="t1">
      <td id="layoutCol0_0" class="colBox" align="center" colspan="2">
                     <div class="colTitle">Wide Display Area</div>
                     <div class="targetMarker"></div>
                    <div class="dragBox dragBoxCaption dragBoxTable" style="left: 0px; top: 0px;">System Information</div>
                   <div class="targetMarker"></div>
      </td>
</tr>

<tr id="t2">

       <td id="layoutCol1_0" class="colBox" align="center" colspan="1">
               <div class="colTitle">Narrow Display Area</div>
               <div class="targetMarker"></div>
     </td>
</tr>


两个tr是平行.
我打算把id="t2"里面红色的那个div拖到 id="t1"上面去,使其和id="t2"的tr一样,实现拖拽的目的,可是我怎么拖也不成功下面是我试过的方法:
        Actions actions = new Actions(driver); 
        Action action;
        actions.clickAndHold(sysInfotext).moveToElement(desPos).release(desPos); 
        action = actions.build(); 
        action.perform(); 


     还有就是(new Actions(driver)).dragAndDrop(sysInfotext, desPos).perform();
我都试过可是都实现不了,我都不知道怎么办了,
求大神帮忙,如需方便加QQ158338582谢谢大家!
2013年5月31日 14:06
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics