lib.wdeMouseUpAt(hwnd.getValue(), new NativeLong(endX), new NativeLong(endY));
}
public void dragAndDropOn(RenderedWebElement toElement) {
HWNDByReference hwnd = new HWNDByReference();
NativeLongByReference x = new NativeLongByReference();
NativeLongByReference y = new NativeLongByReference();
NativeLongByReference width = new NativeLongByReference();
NativeLongByReference height = new NativeLongByReference();
int result = lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height);
errors.verifyErrorCode(result, "Unable to determine location once scrolled on to screen");
NativeLong
startX =
new NativeLong(x.getValue().longValue() + (width.getValue().longValue() / 2));
NativeLong
startY =
new NativeLong(y.getValue().longValue() + (height.getValue().longValue() / 2));
lib.wdeMouseDownAt(hwnd.getValue(), startX, startY);
Pointer other = ((InternetExplorerElement) toElement).element;
result = lib.wdeGetDetailsOnceScrolledOnToScreen(other, hwnd, x, y, width, height);
errors.verifyErrorCode(result,
"Unable to determine location of target once scrolled on to screen");
NativeLong endX = new NativeLong(x.getValue().longValue() + (width.getValue().longValue() / 2));
NativeLong
endY =
new NativeLong(y.getValue().longValue() + (height.getValue().longValue() / 2));
int duration = parent.manage().getSpeed().getTimeOut();
lib.wdeMouseMoveTo(hwnd.getValue(), new NativeLong(duration), startX, startY, endX, endY);
lib.wdeMouseUpAt(hwnd.getValue(), endX, endY);
}