当前位置: 首页>>代码示例>>Java>>正文


Java Mouse类代码示例

本文整理汇总了Java中org.openqa.selenium.interactions.Mouse的典型用法代码示例。如果您正苦于以下问题:Java Mouse类的具体用法?Java Mouse怎么用?Java Mouse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Mouse类属于org.openqa.selenium.interactions包,在下文中一共展示了Mouse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@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;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:18,代码来源:MouseMoveToLocation.java

示例2: dragsCardToOtherLocation

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@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;
}
 
开发者ID:Unisay,项目名称:preferanser,代码行数:18,代码来源:EndUserSteps.java

示例3: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse()
{
    setLastAction();
    if ( webDriver instanceof HasInputDevices )
        return ((HasInputDevices) webDriver).getMouse();
    else
        return null;
}
 
开发者ID:xframium,项目名称:xframium-java,代码行数:10,代码来源:DeviceWebDriver.java

示例4: mouseDown

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:tarun3kumar,项目名称:seleniumtestsframework,代码行数:11,代码来源:HtmlElement.java

示例5: mouseOver

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:tarun3kumar,项目名称:seleniumtestsframework,代码行数:15,代码来源:HtmlElement.java

示例6: mouseUp

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:tarun3kumar,项目名称:seleniumtestsframework,代码行数:11,代码来源:HtmlElement.java

示例7: call

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();

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

  return null;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:13,代码来源:ClickInSession.java

示例8: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse() {
    return ((HasInputDevices) driver).getMouse();
}
 
开发者ID:WileyLabs,项目名称:teasy,代码行数:5,代码来源:WebDriverDecorator.java

示例9: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
 * Mouse doesn't work on mobile devices and emulators.
 */
@Deprecated public Mouse getMouse() {
    return super.getMouse();
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:7,代码来源:DefaultGenericMobileDriver.java

示例10: mouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
private Mouse mouse() {
    return inputDevices().getMouse();
}
 
开发者ID:testinfected,项目名称:mario,代码行数:4,代码来源:WebRobot.java

示例11: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
 * @return the {@link Mouse} of current driver
 */
public Mouse getMouse() {
    return ((HasInputDevices) seleniumWebDriver()).getMouse();
}
 
开发者ID:KarlGong,项目名称:easyium-java,代码行数:7,代码来源:WebDriver.java

示例12: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse()
{
    return ((HasInputDevices)driver).getMouse();
}
 
开发者ID:d0k1,项目名称:jsflight,代码行数:6,代码来源:WebDriverWrapper.java

示例13: getMouse

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse() {
  return driver.getMouse();
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:SeleniumWebDriver.java

示例14: call

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
  mouse.mouseDown(null);
  return null;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:7,代码来源:MouseDown.java

示例15: call

import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Void call() throws Exception {
  Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
  mouse.doubleClick(null);
  return null;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:7,代码来源:DoubleClickInSession.java


注:本文中的org.openqa.selenium.interactions.Mouse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。