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


Java Actions.moveToElement方法代码示例

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


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

示例1: clickAddStepLink

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
public void clickAddStepLink(int pos){

		List<WebElement> allStepInserts = getRootElement().findElements(Element.STEP_INSERT);
		WebElement stepElement = allStepInserts.get(pos);
		Actions action = new Actions(WebDriverRunner.getWebDriver());
		//to make ADD_STEP element visible:
		action.moveToElement(stepElement);

		getRootElement().$(Link.ADD_STEP).shouldBe(visible).click();
	}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:11,代码来源:IntegrationFlowViewComponent.java

示例2: scrollGameIntoView

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
private void scrollGameIntoView() {
	/*
	 * Bellow code doesn't work well (it does not scroll horizontally):
	 * 
	 * ((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", game);
	 */
	Actions actions = new Actions(driver);
	actions.moveToElement(game);
	actions.perform();
}
 
开发者ID:Betalord,项目名称:BHBot,代码行数:11,代码来源:MainThread.java

示例3: hoverOverElement

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
@Deprecated
protected void hoverOverElement(WebElement webElement) {
    maximizeWindow();
    Actions builder = new Actions(getDriver());
    Actions hoverOverWebElement = builder.moveToElement(webElement);
    hoverOverWebElement.perform();
}
 
开发者ID:WileyLabs,项目名称:teasy,代码行数:8,代码来源:AbstractPageElement.java

示例4: moveMouseAway

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
/** Moves mouse to position (0,0) in the 'game' element (so that it doesn't trigger any highlight popups or similar */
private void moveMouseAway() {
	try {
		Actions act = new Actions(driver);
		act.moveToElement(game, 0, 0);
		act.perform();
	} catch(Exception e) {
		// do nothing
	}
}
 
开发者ID:Betalord,项目名称:BHBot,代码行数:11,代码来源:MainThread.java

示例5: 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();
}
 
开发者ID:Betalord,项目名称:BHBot,代码行数:9,代码来源:MainThread.java

示例6: 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();
}
 
开发者ID:Betalord,项目名称:BHBot,代码行数:8,代码来源:MainThread.java

示例7: clickWhenReady

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
public static void clickWhenReady(WebDriver driver, WebElement webElement){
    new WebDriverWait(driver,DEFAULT_WAITING_TIME).until(ExpectedConditions.visibilityOf(webElement));
    Actions actions = new Actions(driver);
    actions.moveToElement(webElement);
    new WebDriverWait(driver,DEFAULT_WAITING_TIME).until(ExpectedConditions.elementToBeClickable(webElement));
    webElement.click();
}
 
开发者ID:voyages-sncf-technologies,项目名称:cerebro,代码行数:8,代码来源:Utils.java

示例8: scroll

import org.openqa.selenium.interactions.Actions; //导入方法依赖的package包/类
protected void scroll(WebElement webElement) {
	Actions actions = new Actions(getWebDriver());
	actions.moveToElement(webElement);
}
 
开发者ID:entelgy-brasil,项目名称:zucchini,代码行数:5,代码来源:GenericStep.java


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