Java 类org.openqa.selenium.interactions.Mouse 实例源码

项目:grid-refactor-remote-server    文件:MouseMoveToLocation.java   
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();

  Coordinates elementLocation = null;
  if (elementProvided) {
    WebElement element = getKnownElements().get(elementId);
    elementLocation = ((Locatable) element).getCoordinates();
  }

  if (offsetsProvided) {
    mouse.mouseMove(elementLocation, xOffset, yOffset);
  } else {
    mouse.mouseMove(elementLocation);
  }
  return null;
}
项目:preferanser    文件:EndUserSteps.java   
@Step
public EndUserSteps dragsCardToOtherLocation(Card card, TableLocation fromLocation, TableLocation toLocation) {
    TablePage page = getTablePage();

    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;
}
项目:xframium-java    文件:DeviceWebDriver.java   
@Override
public Mouse getMouse()
{
    setLastAction();
    if ( webDriver instanceof HasInputDevices )
        return ((HasInputDevices) webDriver).getMouse();
    else
        return null;
}
项目:seleniumtestsframework    文件:HtmlElement.java   
/**
 * Forces a mouseDown event on the WebElement.
 */
public void mouseDown() {
    TestLogging.log("MouseDown " + this.toString());
    findElement();

    final Mouse mouse = ((HasInputDevices) driver).getMouse();
    mouse.mouseDown(null);
}
项目:seleniumtestsframework    文件:HtmlElement.java   
/**
 * Forces a mouseOver event on the WebElement.
 */
public void mouseOver() {
    TestLogging.log("MouseOver " + this.toString());
    findElement();

    // build and perform the mouseOver with Advanced User Interactions API
    // Actions builder = new Actions(driver);
    // builder.moveToElement(element).build().perform();
    final Locatable hoverItem = (Locatable) element;
    final Mouse mouse = ((HasInputDevices) driver).getMouse();
    mouse.mouseMove(hoverItem.getCoordinates());
}
项目:seleniumtestsframework    文件:HtmlElement.java   
/**
 * Forces a mouseUp event on the WebElement.
 */
public void mouseUp() {
    TestLogging.log("MouseUp " + this.toString());
    findElement();

    final Mouse mouse = ((HasInputDevices) driver).getMouse();
    mouse.mouseUp(null);
}
项目:grid-refactor-remote-server    文件:ClickInSession.java   
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();

  if (leftMouseButton) {
    mouse.click(null);
  } else {
    mouse.contextClick(null);
  }

  return null;
}
项目:teasy    文件:WebDriverDecorator.java   
@Override
public Mouse getMouse() {
    return ((HasInputDevices) driver).getMouse();
}
项目:menggeqa    文件:DefaultGenericMobileDriver.java   
/**
 * Mouse doesn't work on mobile devices and emulators.
 */
@Deprecated public Mouse getMouse() {
    return super.getMouse();
}
项目:easytest    文件:DeviceWebDriver.java   
@Override
public Mouse getMouse() {
    return ((HasInputDevices) driver).getMouse();
}
项目:mario    文件:WebRobot.java   
private Mouse mouse() {
    return inputDevices().getMouse();
}
项目:easyium-java    文件:WebDriver.java   
/**
 * @return the {@link Mouse} of current driver
 */
public Mouse getMouse() {
    return ((HasInputDevices) seleniumWebDriver()).getMouse();
}
项目:jsflight    文件:WebDriverWrapper.java   
@Override
public Mouse getMouse()
{
    return ((HasInputDevices)driver).getMouse();
}
项目:che    文件:SeleniumWebDriver.java   
@Override
public Mouse getMouse() {
  return driver.getMouse();
}
项目:grid-refactor-remote-server    文件:MouseDown.java   
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
  mouse.mouseDown(null);
  return null;
}
项目:grid-refactor-remote-server    文件:DoubleClickInSession.java   
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
  mouse.doubleClick(null);
  return null;
}
项目:grid-refactor-remote-server    文件:MouseUp.java   
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
  mouse.mouseUp(null);
  return null;
}
项目:web-test-framework    文件:Driver.java   
/**
 *
 * @return
 */
@Override
public Mouse getMouse() {
  return ((HasInputDevices) driver).getMouse();
}
项目:cinnamon    文件:HoverAction.java   
@Override
public void perform(final WebElement target) {
    final Locatable hoverItem = (Locatable) target;
    final Mouse mouse = ((HasInputDevices) webDriver).getMouse();
    mouse.mouseMove(hoverItem.getCoordinates());
}
项目:seleniumcapsules    文件:Browser.java   
@Override
default Mouse getMouse() {
    HasInputDevices t = (HasInputDevices) get();
    return t.getMouse();
}
项目:minium    文件:StatefulWebDriver.java   
@Override
public Mouse getMouse() {
    return ((HasInputDevices) webDriver).getMouse();
}
项目:minium    文件:BaseDocumentWebDriver.java   
@Override
public Mouse getMouse() {
    return ((HasInputDevices) webDriver).getMouse();
}
项目:minium    文件:DelegatorWebDriver.java   
protected Mouse delegateMouse() {
    return ((HasInputDevices) delegate).getMouse();
}
项目:minium    文件:DelegatorWebDriver.java   
@Override
public Mouse getMouse() {
    return new DelegatorMouse();
}
项目:minium    文件:MockWebDriver.java   
@Override
public Mouse getMouse() {
    return mockMouse;
}
项目:qaf    文件:QAFWebDriver.java   
Mouse getMouse();