Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Drag And Drop not Working in a Sortable JQuery List #5149

@lukeis

Description

@lukeis

Originally reported on Google Code with ID 5149


While trying to test sorting a Sortable List using Selenium WebDriver. The javascript
which causes the 'planceholder' does not render while the Selenium Drag and Drop Action
occurs,  causing the target element to remain in position.


Source:

<div id="ReorderEvents">
            <ul id="EventsToEdit" class="sortable ui-sortable">
                    <li id="156309" class="ui-state-default ui-corner-all"><span class="ui-icon
ui-icon-arrowthick-2-n-s"></span>Event1</li>
                    <li id="156310" class="ui-state-default ui-corner-all"><span class="ui-icon
ui-icon-arrowthick-2-n-s"></span>Event2</li>
                    <li id="156311" class="ui-state-default ui-corner-all"><span class="ui-icon
ui-icon-arrowthick-2-n-s"></span>Event3</li>
                    <li id="156312" class="ui-state-default ui-corner-all"><span class="ui-icon
ui-icon-arrowthick-2-n-s"></span>Event4</li>
            </ul>
        </div>

$("#EventsToEdit").sortable({
                placeholder: "ui-state-highlight ui-corner-all",
                containment: "#ReorderEvents",
                stop: function (event, ui) {
                    var data = $('#EventsToEdit').sortable('toArray');
                    $("#eventSequence").val(data);
                }
            });


Test:

var eventsItems = GetEventItems(); // Get All Event LI's

foreach (var eventName in value)
{

  var element = eventsItems.Single(x => x.Text.Equals(eventName));
  var target = eventsItems[0];

  //new Actions(Driver).DragAndDrop(element, target).Build().Perform();  

  new Actions(Driver)
      .MoveToElement(element)
      .ClickAndHold()
      .MoveToElement(target)
      .Release()
      .Build()
      .Perform();      
}


This seems to occurs in all 3 browsers

Using Selenium WebDriver 2.28.0
Windows:7
C# 4.5
Firefox (18.0.2)
IE9 
Chrome(Version 24.0.1312.57m)

Reported by AndyLiddle on 2013-02-11 14:47:25

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions