2.0.0rc5
Drag & drop in advanced commands
when Selenium can interact with simple draggable controls:
browser.element('#volume-slider-thumb').perform(command.drag_and_drop_to(browser.element('#volume-up')))
- when for some reason, for example because of not loaded page yet, you have to retry dragging until we can asset that element actually was moved to the new location:
browser.element('#volume-slider-thumb').perform(command.drag_and_drop_to(browser.element('#volume-up'), _assert_location_changed=True))
the_assert_location_changed=True
is marked as experimental by_
prefix,
so it may be renamed or removed in future releases.
browser.element('#volume-slider-thumb').perform(command.drag_and_drop_by_offset(x=-10, y=0))
when Selenium can not interact with simple draggable controls:
browser.element('#volume-slider-thumb').perform(command.js.drag_and_drop_to(browser.element('#volume-up')))
when there is no input element with type file, and you need to simulate the "drop file" by JS:
browser.element('#drag-file-here-to-upload').perform(command.js.drop_file('/path/to/file'))
Find more examples at these tests: