當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。