Example usage for org.openqa.selenium.interactions Mouse mouseUp

List of usage examples for org.openqa.selenium.interactions Mouse mouseUp

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions Mouse mouseUp.

Prototype

void mouseUp(Coordinates where);

Source Link

Usage

From source file:com.elastica.webelements.HtmlElement.java

License:Apache License

/**
 * Forces a mouseUp event on the WebElement.
 *//*  w ww . ja  v  a 2 s . co  m*/
public void mouseUp() {
    TestLogging.log("MouseUp " + this.toString());
    findElement();

    Mouse mouse = ((HasInputDevices) driver).getMouse();
    mouse.mouseUp(null);
}

From source file:com.preferanser.webtest.steps.EndUserSteps.java

License:Open Source License

@Step
public EndUserSteps dragsCardToOtherLocation(Card card, TableLocation fromLocation, TableLocation toLocation) {
    TablePage page = getTablePage();//  w w  w  .j  a  va2s  .  c  o m

    Optional<WebElementFacade> maybeCard = page.getCardAtTableLocationElement(card, fromLocation);
    assertTrue(maybeCard.isPresent());

    Optional<WebElementFacade> maybeTableLocation = page.getTableLocationElement(toLocation);
    assertTrue(maybeTableLocation.isPresent());

    Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
    mouse.mouseMove(maybeCard.get().getCoordinates(), 3, 3); // grab the top left corner
    mouse.mouseDown(null); // at the current location
    mouse.mouseMove(maybeTableLocation.get().getCoordinates());
    mouse.mouseUp(maybeTableLocation.get().getCoordinates());
    return this;
}

From source file:org.oneandone.qxwebdriver.ui.core.WidgetImpl.java

License:LGPL

public void drop(Widget target) throws InterruptedException {
    Mouse mouse = ((HasInputDevices) driver.getWebDriver()).getMouse();
    dragOver(target);//w w  w.  ja v  a 2 s  . c  om

    Locatable targetL = (Locatable) target.getContentElement();
    mouse.mouseUp(targetL.getCoordinates());

}

From source file:org.oneandone.qxwebdriver.ui.mobile.core.WidgetImpl.java

License:LGPL

public static void longtap(WebDriver driver, WebElement element) {
    if (driver instanceof HasTouchScreen) {
        TouchActions longtap = new TouchActions(driver);
        Point center = getCenter(element);
        longtap.down(center.getX(), center.getY());
        longtap.perform();/* w  w w .j  ava2 s  .  c o  m*/
        try {
            Thread.sleep(750);
        } catch (InterruptedException e) {
        }
        longtap.up(center.getX(), center.getY());
        longtap.perform();
    } else {
        Locatable locatable = (Locatable) element;
        Coordinates coords = locatable.getCoordinates();
        Mouse mouse = ((HasInputDevices) driver).getMouse();
        mouse.mouseDown(coords);
        try {
            Thread.sleep(750);
        } catch (InterruptedException e) {
        }
        mouse.mouseUp(coords);
    }
}

From source file:org.richfaces.tests.metamer.ftest.richContextMenu.TestContextMenu.java

License:Open Source License

@Test
@CoversAttributes("onmouseup")
@Templates(value = "plain")
public void testOnmouseup() {
    updateShowAction();//w w w  .  j av  a2 s . c  o  m
    testFireEvent(contextMenuAttributes, ContextMenuAttributes.onmouseup, new Action() {
        @Override
        public void perform() {
            page.getContextMenu().advanced().show(page.getTargetPanel1());
            Mouse mouse = ((HasInputDevices) driver).getMouse();
            Coordinates coords = ((Locatable) page.getContextMenu().advanced().getItemsElements().get(2))
                    .getCoordinates();
            mouse.mouseDown(coords);
            mouse.mouseUp(coords);
        }
    });
}

From source file:org.richfaces.tests.metamer.ftest.richDropDownMenu.AbstractDropDownMenuTest.java

License:Open Source License

@CoversAttributes("onmouseup")
public void testOnmouseup() {
    updateDropDownMenuInvoker();//w  ww  . ja v  a2 s.c om
    testFireEvent(dropDownMenuAttributes, DropDownMenuAttributes.onmouseup, new Action() {
        @Override
        public void perform() {
            getCurrentMenu().advanced().show(page.getTarget1());
            Mouse mouse = ((HasInputDevices) driver).getMouse();
            Coordinates coords = ((Locatable) getCurrentMenu().advanced().getItemsElements().get(1))
                    .getCoordinates();
            mouse.mouseDown(coords);
            mouse.mouseUp(coords);
        }
    });
}

From source file:org.specrunner.webdriver.actions.input.mouse.PluginMouseUpCoordinates.java

License:Open Source License

@Override
protected void doEnd(IContext context, IResultSet result, WebDriver client, HasInputDevices input, Mouse mouse)
        throws PluginException {
    mouse.mouseUp(getCoordinates());
    result.addResult(Success.INSTANCE, context.peek());
}