本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}
示例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;
}
示例8: getMouse
import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse() {
return ((HasInputDevices) driver).getMouse();
}
示例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();
}
示例10: mouse
import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
private Mouse mouse() {
return inputDevices().getMouse();
}
示例11: getMouse
import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
/**
* @return the {@link Mouse} of current driver
*/
public Mouse getMouse() {
return ((HasInputDevices) seleniumWebDriver()).getMouse();
}
示例12: getMouse
import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse()
{
return ((HasInputDevices)driver).getMouse();
}
示例13: getMouse
import org.openqa.selenium.interactions.Mouse; //导入依赖的package包/类
@Override
public Mouse getMouse() {
return driver.getMouse();
}
示例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;
}
示例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;
}