Search in sources :

Example 1 with Actions

use of org.openqa.selenium.interactions.Actions in project zeppelin by apache.

the class ParagraphActionsIT method testEditOnDoubleClick.

@Test
public void testEditOnDoubleClick() throws Exception {
    if (!endToEndTestEnabled()) {
        return;
    }
    try {
        createNewNote();
        Actions action = new Actions(driver);
        waitForParagraph(1, "READY");
        setTextOfParagraph(1, "%md");
        driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.ARROW_RIGHT);
        driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.ENTER);
        driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.SHIFT + "3");
        driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(" abc");
        runParagraph(1);
        waitForParagraph(1, "FINISHED");
        collector.checkThat("Markdown editor is hidden after run ", driver.findElements(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-if, 'paragraph.config.editorHide')]")).size(), CoreMatchers.equalTo(0));
        collector.checkThat("Markdown editor is shown after run ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(), CoreMatchers.equalTo(true));
        // to check if editOnDblClick field is fetched correctly after refresh
        driver.navigate().refresh();
        waitForParagraph(1, "FINISHED");
        action.doubleClick(driver.findElement(By.xpath(getParagraphXPath(1)))).perform();
        ZeppelinITUtils.sleep(1000, false);
        collector.checkThat("Markdown editor is shown after double click ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-if, 'paragraph.config.editorHide')]")).isDisplayed(), CoreMatchers.equalTo(true));
        collector.checkThat("Markdown editor is hidden after double click ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(), CoreMatchers.equalTo(false));
        deleteTestNotebook(driver);
    } catch (Exception e) {
        handleException("Exception in ParagraphActionsIT while testEditOnDoubleClick ", e);
    }
}
Also used : Actions(org.openqa.selenium.interactions.Actions) Test(org.junit.Test)

Example 2 with Actions

use of org.openqa.selenium.interactions.Actions in project ghostdriver by detro.

the class MouseCommandsTest method doubleClick.

@Test
public void doubleClick() {
    WebDriver d = getDriver();
    Actions actionBuilder = new Actions(d);
    d.get("http://www.duckduckgo.com");
    // Double click
    actionBuilder.doubleClick().build().perform();
    // Double click on the logo
    actionBuilder.doubleClick(d.findElement(By.id("logo_homepage_link"))).build().perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) Actions(org.openqa.selenium.interactions.Actions) Test(org.junit.Test)

Example 3 with Actions

use of org.openqa.selenium.interactions.Actions in project ghostdriver by detro.

the class MouseCommandsTest method clickAndHold.

@Test
public void clickAndHold() {
    WebDriver d = getDriver();
    Actions actionBuilder = new Actions(d);
    d.get("http://www.duckduckgo.com");
    // Hold, then release
    actionBuilder.clickAndHold().build().perform();
    actionBuilder.release();
    // Hold on the logo, then release
    actionBuilder.clickAndHold(d.findElement(By.id("logo_homepage_link"))).build().perform();
    actionBuilder.release();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) Actions(org.openqa.selenium.interactions.Actions) Test(org.junit.Test)

Example 4 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class Action method pageDown.

public void pageDown() {
    Actions clicker = new Actions(driver);
    clicker.sendKeys(Keys.PAGE_DOWN);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 5 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class Action method pressShiftAndTab.

// Method to press shift + tab
public void pressShiftAndTab() {
    Actions action = new Actions(driver);
    action.sendKeys(Keys.chord(Keys.SHIFT), Keys.chord(Keys.TAB)).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Aggregations

Actions (org.openqa.selenium.interactions.Actions)93 WebElement (org.openqa.selenium.WebElement)53 WebDriver (org.openqa.selenium.WebDriver)25 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 Test (org.junit.Test)15 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 JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)1 EditCategoryComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject)1 AddPinComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.interactivemaps.AddPinComponentObject)1