JS Testing Academy · QA Demo Site

Droppable

Drag the source onto the target. One target accepts anything, one only accepts the box marked acceptable, and one sends the item back if you drop it in the wrong place.

Acceptable
Not acceptable
Accepts anything
Accepts only "Acceptable"

Practice tasks

  1. Drag Acceptable onto the first target and assert the target text changes to Dropped.
  2. Drag Not acceptable onto the restricted target and assert it is rejected.
  3. Drag Acceptable onto the restricted target and assert it is accepted.
  4. Click Reset and assert both targets go back to their original text.
  5. Assert the result log records each drop attempt.
Sample automation code
Actions actions = new Actions(driver);
actions.dragAndDrop(
    driver.findElement(By.id("drag-acceptable")),
    driver.findElement(By.id("drop-any"))).perform();

Assert.assertTrue(driver.findElement(By.id("drop-any")).getText().contains("Dropped"));