Skip to content

2.0.0rc5

Compare
Choose a tag to compare
@yashaka yashaka released this 22 Jan 17:24
· 135 commits to master since this release

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: