本文整理汇总了Java中org.openqa.selenium.interactions.Actions.click方法的典型用法代码示例。如果您正苦于以下问题:Java Actions.click方法的具体用法?Java Actions.click怎么用?Java Actions.click使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.interactions.Actions
的用法示例。
在下文中一共展示了Actions.click方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clickOnSeg
import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
/** Performs a mouse click on the center of the given segment */
private void clickOnSeg(MarvinSegment seg) {
Actions act = new Actions(driver);
act.moveToElement(game, getSegCenterX(seg), getSegCenterY(seg));
act.click();
act.moveToElement(game, 0, 0); // so that the mouse doesn't stay on the button, for example. Or else button will be highlighted and cue won't get detected!
act.perform();
}
示例2: clickInGame
import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
private void clickInGame(int x, int y) {
Actions act = new Actions(driver);
act.moveToElement(game, x, y);
act.click();
act.moveToElement(game, 0, 0); // so that the mouse doesn't stay on the button, for example. Or else button will be highlighted and cue won't get detected!
act.perform();
}