0
當我用Selenium拖放某些東西時,看起來好像CSS並未更新。使用Selemium Webdriver自動化一個使用jQuery拖放的頁面
$driver.action.click_and_hold(item).move_by(0 , distanceToDrop).release.perform
拖動和拖放工作正常。就像你將它拖到一個不受支持的位置,它會彈回來。據我所知,該頁面使用jQuery「sortables」。以下是我嘗試自動化的頁面部分的HTML。
<p class="hint">Drop and drag the categories to the order they should appear on the screen.</p>
<div class="sortables " id="yw0">
<div class="sorted_items" id="4">Sample Inputs</div>
<div class="sorted_items" id="3">Social Media Information</div>
<div class="sorted_items" id="2">Numbers of Computers</div>
<div class="sorted_items" id="1">Category 1</div>
</div><form id="organize-categories-form" action="/listCustomFieldCategories/index" method="post"> <input type="hidden" id="new_order" name="new_order" value=""/>