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); }
public void dragAndDropBy(int moveRightBy, int moveDownBy) { 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"); lib.wdeMouseDownAt(hwnd.getValue(), x.getValue(), y.getValue()); long endX = x.getValue().longValue() + moveRightBy; long endY = y.getValue().longValue() + moveDownBy; int duration = parent.manage().getSpeed().getTimeOut(); lib.wdeMouseMoveTo(hwnd.getValue(), new NativeLong(duration), x.getValue(), y.getValue(), new NativeLong(endX), new NativeLong(endY)); lib.wdeMouseUpAt(hwnd.getValue(), new NativeLong(endX), new NativeLong(endY)); }
public Speed getSpeed() { return options.getSpeed(); }
public Speed getSpeed() { return options.getSpeed(); }
public ResultType call() throws Exception { response = newResponse(); response.setValue(getDriver().manage().getSpeed()); return ResultType.SUCCESS; }
public ResultType call() throws Exception { response = newResponse(); response.setValue(getDriver().manage().getSpeed()); return ResultType.SUCCESS; }