You can see a simple HTML5 drag and drop example here on the-internet.
require 'selenium-webdriver' require 'rspec-expectations' def setup @driver = Selenium::WebDriver.for :firefox end def teardown @driver.quit end def run setup yield teardown end
After including our dependent libraries, we wire up our
run actions. Now we're ready to write our test.
After loading the page we read in the
dnd.js file and store it in a local variable. We then use Selenium to execute
Since there are only two elements to drag and drop on the page, they should have switched places. So,
column-a should now contain the text 'B', and
column-b should contain the text 'A'.
Hopefully this tip has helped you figure out how to wrangle HTML5 dragging and dropping while there is a known bug for it in Selenium.