Search in sources :

Example 96 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditModePageObject method selectFromContextMenu.

private void selectFromContextMenu(WebElement option) {
    wait.forElementVisible(iframe);
    driver.switchTo().frame(iframe);
    Actions actions = new Actions(driver);
    actions.contextClick(visualModeTable).build().perform();
    driver.switchTo().defaultContent();
    driver.switchTo().frame(contextFrame);
    option.click();
    driver.switchTo().defaultContent();
    isElementOnPage(visualModeTable);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 97 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VideoFanTakeover method clickOnAdImage.

public void clickOnAdImage() {
    runInAdFrame(() -> {
        final By adImageTrigger = By.cssSelector("#adContainer a");
        wait.forElementClickable(adImageTrigger);
        //do not click in the middle of image, there might be click to play there
        new Actions(driver).moveToElement(driver.findElement(adImageTrigger), 10, 10).click().build().perform();
        PageObjectLogging.log("clickOnAdImage", "ad image clicked", true, driver);
    });
}
Also used : Actions(org.openqa.selenium.interactions.Actions) JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) By(org.openqa.selenium.By)

Example 98 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorPageObject method clickTransclusion.

public void clickTransclusion(int index, Transclusion transclusion) {
    Point tempLocation = getTransclusionLocation(index, transclusion);
    int xOffset = 10;
    int yOffset = 10;
    int tempLeft = tempLocation.x + xOffset;
    int tempTop = tempLocation.y + yOffset;
    editArea.click();
    Actions actions = new Actions(driver);
    actions.moveToElement(mainContent, tempLeft, tempTop).clickAndHold().release().build().perform();
    WebElement contextEdit = contextMenu.findElement(contextMenuBy).findElement(contextEditBy);
    wait.forElementVisible(contextEdit);
    PageObjectLogging.log("clickTransclusion", "Clicked at X: " + tempLeft + ", Y: " + tempTop, true, driver);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 99 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorPageObject method resizeMedia.

private void resizeMedia(int xOffSet, int yOffset) {
    PageObjectLogging.log("resizeMedia", "Before resizing", true, driver);
    selectMedia();
    wait.forElementVisible(swResizeHandle);
    Actions actions = new Actions(driver);
    actions.dragAndDropBy(swResizeHandle, xOffSet, yOffset).build().perform();
    PageObjectLogging.log("resizeMedia", "After resizing", true, driver);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 100 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorPageObject method deleteTransclusion.

public void deleteTransclusion(int index, Transclusion transclusion) {
    clickTransclusion(index, transclusion);
    Actions actions2 = new Actions(driver);
    actions2.sendKeys(Keys.DELETE).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Aggregations

Actions (org.openqa.selenium.interactions.Actions)116 WebElement (org.openqa.selenium.WebElement)72 WebDriver (org.openqa.selenium.WebDriver)26 Test (org.junit.Test)21 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 Action (org.openqa.selenium.interactions.Action)10 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)9 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)6 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)4 List (java.util.List)3 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)2 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)2 MobileElementState (com.axway.ats.uiengine.utilities.mobile.MobileElementState)2 AndroidDriver (io.appium.java_client.android.AndroidDriver)2 File (java.io.File)2 DecimalFormat (java.text.DecimalFormat)2 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)2 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 VerticalLayoutElement (com.vaadin.testbench.elements.VerticalLayoutElement)1