Wpis z mikrobloga

@Abriam: Stackoverflow sie popsuło? ;)

// Configure the action
Actions builder = new Actions(driver);

builder.keyDown(Keys.CONTROL)
.click(someElement)
.click(someOtherElement)
.keyUp(Keys.CONTROL);

// Then get the action:
Action selectMultiple = builder.build();

// And execute it:
selectMultiple.perform();

or

Actions builder = new Actions(driver);

Action dragAndDrop = builder.clickAndHold(someElement)
.moveToElement(otherElement)
.release(otherElement)
.build();

dragAndDrop.perform();
Czasem jeszcze jest tak że dragAndDrop z klasy Actions nie działa bo front potrzebuje czasu po kliknięciu w element żeby można go było ruszyć. Wtedy zrób clickAndHold, małego sleepa i dopiero moveToElement