Search in sources :

Example 71 with Actions

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

the class HiddenHtmlElement method dragAndDropTo.

/**
     * Drag and drop an element on top of other element
     * @param targetElement the target element
     */
@Override
@PublicAtsApi
public void dragAndDropTo(HtmlElement targetElement) {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    WebElement source = HiddenHtmlElementLocator.findElement(this);
    WebElement target = HiddenHtmlElementLocator.findElement(targetElement);
    Actions actionBuilder = new Actions(htmlUnitDriver);
    Action dragAndDropAction = actionBuilder.clickAndHold(source).moveToElement(target, 1, 1).release(target).build();
    dragAndDropAction.perform();
// drops the source element in the middle of the target, which in some cases is not doing drop on the right place
// new Actions( htmlUnitDriver ).dragAndDrop( source, target ).perform();
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) Action(org.openqa.selenium.interactions.Action) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 72 with Actions

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

the class HiddenHtmlElement method pressTabKey.

/**
     * Simulate Tab key
     */
@Override
@PublicAtsApi
public void pressTabKey() {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    WebElement element = HiddenHtmlElementLocator.findElement(this);
    new Actions(htmlUnitDriver).sendKeys(element, Keys.TAB).perform();
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 73 with Actions

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

the class HiddenHtmlElement method pressEnterKey.

/**
     * Simulate Enter key
     */
@Override
@PublicAtsApi
public void pressEnterKey() {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    WebElement element = HiddenHtmlElementLocator.findElement(this);
    new Actions(htmlUnitDriver).sendKeys(element, "\r").perform();
//        new Actions( htmlUnitDriver ).sendKeys( element, Keys.RETURN ).perform();
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 74 with Actions

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

the class HiddenHtmlElement method doubleClick.

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

Example 75 with Actions

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

the class Action method scrollUp.

//scrolling up using Actions class
public void scrollUp() {
    Actions action = new Actions(driver);
    action.keyDown(Keys.CONTROL).sendKeys(Keys.UP).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