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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations