Search in sources :

Example 21 with Actions

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

the class InteractiveMapPageObject method placePinInMap.

public AddPinComponentObject placePinInMap() {
    wait.forElementVisible(mapFrame);
    jsActions.scrollElementIntoViewPort(mapFrame);
    driver.switchTo().frame(mapFrame);
    wait.forElementVisible(addPinButton);
    addPinButton.click();
    Actions actions = new Actions(driver);
    actions.moveToElement(mapImagesCollection.get(0));
    actions.click().perform();
    driver.switchTo().defaultContent();
    PageObjectLogging.log("placePinInMap", "Pin was placed in map", true);
    return new AddPinComponentObject(driver);
}
Also used : Actions(org.openqa.selenium.interactions.Actions) AddPinComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.interactivemaps.AddPinComponentObject)

Example 22 with Actions

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

the class InteractiveMapPageObject method clickOnPin.

public void clickOnPin(Integer pinListPosition, boolean... noFrame) {
    if (noFrame.length == 0) {
        wait.forElementVisible(mapFrame);
        driver.switchTo().frame(mapFrame);
    }
    wait.forElementVisible(pinCollection.get(pinListPosition));
    jsActions.scrollToElement(pinCollection.get(pinListPosition));
    Actions actions = new Actions(driver);
    actions.moveToElement(pinCollection.get(pinListPosition));
    actions.click().perform();
    PageObjectLogging.log("clickOnPin", "Pin was clicked", true, driver);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 23 with Actions

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

the class InteractiveMapPageObject method clickOnFilterBoxTitle.

public void clickOnFilterBoxTitle() {
    wait.forElementVisible(mapFrame);
    jsActions.scrollToElement(mapFrame);
    driver.switchTo().frame(mapFrame);
    wait.forElementVisible(filterBoxTitle);
    Actions actions = new Actions(driver);
    actions.moveToElement(filterBoxTitle).click().perform();
    driver.switchTo().defaultContent();
    PageObjectLogging.log("clickOnFilterBoxTitle", "Filter box title was clicked", true);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 24 with Actions

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

the class VisualEditModePageObject method removeCategory.

public void removeCategory(String categoryName) {
    WebElement removeCategory = driver.findElement(By.cssSelector(categoryRemoveSelector.replace("%categoryName%", categoryName)));
    WebElement category = driver.findElement(By.cssSelector(".category[data-name='" + categoryName + "']"));
    new Actions(driver).moveToElement(category).perform();
    scrollAndClick(removeCategory);
    PageObjectLogging.log("removeCategory", "remove category button clicked on category " + categoryName, true);
}
Also used : Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 25 with Actions

use of org.openqa.selenium.interactions.Actions in project rstudio by rstudio.

the class MenuNavigator method getMenuItem.

public static WebElement getMenuItem(final WebDriver driver, String level1, String level2, String level3) {
    WebElement popupItem = getMenuItem(driver, level1, level2);
    Actions action = new Actions(driver);
    action.moveToElement(popupItem).build().perform();
    // Wait for there to be two popups open (the level1 and level2 menus)
    (new WebDriverWait(driver, 1)).until(new ExpectedCondition<Boolean>() {

        public Boolean apply(WebDriver d) {
            List<WebElement> elements = driver.findElements(By.className("gwt-MenuBarPopup"));
            return elements.size() > 1;
        }
    });
    // Get the second popup menu
    List<WebElement> elements = driver.findElements(By.className("gwt-MenuBarPopup"));
    WebElement menu2popup = elements.get(1);
    return findMenuItemByName(menu2popup, level3);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) Actions(org.openqa.selenium.interactions.Actions) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) List(java.util.List) WebElement(org.openqa.selenium.WebElement)

Aggregations

Actions (org.openqa.selenium.interactions.Actions)100 WebElement (org.openqa.selenium.WebElement)59 WebDriver (org.openqa.selenium.WebDriver)26 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 Test (org.junit.Test)16 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 Action (org.openqa.selenium.interactions.Action)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 JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)1