使用Java

时间:2016-11-21 13:09:14

标签: java selenium webdriver

我想使用selenium webdriver和java自动执行拖放功能。

我试过了:

Actions action = new Actions(driver);

action.dragAndDrop(Sourcelocator, Destinationlocator).build().perform();

但没有发生任何事情

有人可以帮忙吗?

使用HTML5

部分的HTML代码
<div id="scroll" class="sort-list-wrap" style="height:450px">
<ul id="questiondiv" class="connected-sort ullist ui-sortable" style="overflow-y: scroll;height:450px">
<li id="id_365">
<li id="id_356">
<li id="id_355">
<li id="id_354">
<li id="id_353">
<li id="id_352">
</ul>
</div>
<div id="loading" class="loading-text" style="display: none;">
<img src="/Images/loader-small.gif" alt="loader-small">
Loading questions..
</div>
<div id="loadmore" class="btn-wrap text-center" style="height: 42px;">
<a class="btn btn-outline-primary purple" onclick="loadMore();">Load more</a>
</div>

<div class="as-cell qd-arrow">
<i class="icon-sort-arrow" aria-hidden="true"></i>
</div>
<div class="as-cell">
<div class="panel v3-panel">
<div class="panel-header table-header has-border">
<div class="ph-title">
<h2>Selected Questions</h2>
<p>Reorder the selected questions in this section.</p>
</div>
</div>
<div class="panel-body">
<h2 class="qstn-title">
<strong id="quescount_lbl">0 / 5</strong>
questions selected
</h2>
<div id="questiondropdiv" class="sort-list-wrap mCustomScrollbar1" style="overflow: hidden;">
<ul id="secondList" class="connected-sort ullist ui-sortable" style="overflow-y: scroll;height:550px"> </ul>
</div>

0 个答案:

没有答案