Search in sources :

Example 56 with Actions

use of org.openqa.selenium.interactions.Actions in project charts by vaadin.

the class RangeSelectorCustomDateParserTBTest method setRangeValue.

private void setRangeValue(String value, WebElement input) {
    Actions action = new Actions(driver);
    // Should be done as one action, otherwise does not work
    action.doubleClick(input).sendKeys(Keys.chord(Keys.CONTROL, "a")).sendKeys(Keys.BACK_SPACE).sendKeys(value).sendKeys(Keys.TAB).perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 57 with Actions

use of org.openqa.selenium.interactions.Actions in project charts by vaadin.

the class ColumnWithShapedTooltipTBTest method testCustomStuff.

@Override
protected void testCustomStuff() {
    super.testCustomStuff();
    WebElement findElement = driver.findElement(By.id("chart"));
    Action move = new Actions(driver).moveToElement(findElement, 415, 280).build();
    move.perform();
}
Also used : Action(org.openqa.selenium.interactions.Action) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 58 with Actions

use of org.openqa.selenium.interactions.Actions in project charts by vaadin.

the class ServerSideEventsTBTest method setXAxesExtremes_occured_eventIsFired.

@Test
public void setXAxesExtremes_occured_eventIsFired() {
    skipBrowser("Selecting area through Testbench does not work correctly", Browser.CHROME, Browser.PHANTOMJS);
    openTestUI();
    WebElement chart = driver.findElement(By.className("vaadin-chart"));
    new Actions(driver).moveToElement(chart, 200, 100).click().clickAndHold().moveByOffset(50, 0).release().build().perform();
    assertLastEventIsType(XAxesExtremesChangeEvent.class);
}
Also used : Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) Test(org.junit.Test)

Example 59 with Actions

use of org.openqa.selenium.interactions.Actions in project ats-framework by Axway.

the class RealHtmlElement method doubleClick.

/**
     * Simulate mouse double click action
     */
@Override
@PublicAtsApi
public void doubleClick() {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    new Actions(webDriver).doubleClick(element).perform();
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 60 with Actions

use of org.openqa.selenium.interactions.Actions in project ats-framework by Axway.

the class RealHtmlElement method mouseOver.

/**
     * Simulate mouse over
     */
@Override
@PublicAtsApi
public void mouseOver() {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    // 1. option
    new Actions(webDriver).moveToElement(element).perform();
    // 2. option
    //        element.sendKeys( "" );
    // 3. option
    //        Mouse mouse = ( ( HasInputDevices ) webDriver ).getMouse();
    //        mouse.mouseMove( ( ( RemoteWebElement ) element ).getCoordinates() );
    // 4. option
    //        String javaScript = "var evObj = document.createEvent('MouseEvents');"
    //                            + "evObj.initMouseEvent(\"mouseover\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);"
    //                            + "arguments[0].dispatchEvent(evObj);";
    //        JavascriptExecutor js = ( JavascriptExecutor ) webDriver;
    //        js.executeScript( javaScript, element );
    UiEngineUtilities.sleep();
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

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