6

I am trying to simulate a Drag & Drop event that is done using JQuery in my site. Manually performing the "drag & drop" with my own JQuery "works", but after the form where the drag & drop event is located is submitted, nothing will happen because there are event-listeners attached to the mouse drag and drop events, and these listeners don't get triggered by my "manual" movements. I am looking for something similar to Testing jQuery Drag & Drop and Droppable with Selenium.

This is a sample of the code that works only visually, but doesn't trigger the drag&drop event handlers:

// "Simulate" drag&drop
casper.evaluate(function() {
  det = jQuery("table#draggableview_secondary_touts_block_order_1 tbody tr").last().detach();
  jQuery("table#draggableview_secondary_touts_block_order_1 tbody").prepend(det);
  jQuery("form#draggableviews-view-draggabletable-form-secondary-touts-block-order-homepage").submit();
});
Community
  • 1
  • 1
amateur barista
  • 4,440
  • 3
  • 25
  • 37

1 Answers1

0

You could fire the events directly, as show here: https://ghostinspector.com/blog/simulate-drag-and-drop-javascript-casperjs/

does that suite your purposes, or do you need the events triggered on a higher level?

DZack
  • 199
  • 1
  • 1
  • 7