Selenium WebDriver 4

Drag by offset

Hard120 pts~45 min
  • Actions API
  • Offsets
  • Range inputs
Practice app · Board Planner

Hover menus, drag and drop, context menu, click-and-hold and keyboard shortcuts.

Test URL
/lab/selenium-drag-by-offset

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Drag the timeline slider by a pixel offset until it reaches its maximum value.

Your task

  1. 1Locate #offset-slider and assert #slider-value starts at “50”.
  2. 2Read the slider width and drag it horizontally by that offset (dragAndDropBy / drag_and_drop_by_offset / DragAndDropToOffset).
  3. 3Assert #slider-value reads “100”.

Acceptance criteria

  • The slider is moved with an offset-based Actions drag
  • #slider-value shows “100”
  • At least 2 assertions pass

Constraints

  • Do not change the value with keyboard keys or JavaScript.

Selenium WebDriver 4 · Selenium · Mouse & keyboard actions