List of usage examples for org.openqa.selenium.interactions Action perform
void perform();
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void doubleClick(String locator) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); actions.doubleClick(webElement);/*from www. j a v a2 s . c om*/ Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void doubleClickAt(String locator, String coordString) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); if (Validator.isNotNull(coordString) && coordString.contains(",")) { String[] coords = coordString.split(","); int x = GetterUtil.getInteger(coords[0]); int y = GetterUtil.getInteger(coords[1]); actions.moveToElement(webElement, x, y); actions.doubleClick();/*from www . java 2 s .c om*/ } else { actions.doubleClick(webElement); } Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void dragAndDropToObject(String locatorOfObjectToBeDragged, String locatorOfDragDestinationObject) { WebElement objectToBeDraggedWebElement = getWebElement(locatorOfObjectToBeDragged); WrapsDriver wrapsDriver = (WrapsDriver) objectToBeDraggedWebElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); WebElement dragDestinationObjectWebElement = getWebElement(locatorOfDragDestinationObject); actions.dragAndDrop(objectToBeDraggedWebElement, dragDestinationObjectWebElement); Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void keyDown(String locator, String keySequence) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); String keycode = keySequence.substring(1); Keys keys = Keys.valueOf(keycode);/*from w ww .ja va 2s . c om*/ actions.keyDown(webElement, keys); Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void keyPress(String locator, String keySequence) { WebElement webElement = getWebElement(locator); if (keySequence.startsWith("\\")) { String keycode = keySequence.substring(1); if (isValidKeycode(keycode)) { Keys keys = Keys.valueOf(keycode); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); if (keycode.equals("ALT") || keycode.equals("COMMAND") || keycode.equals("CONTROL") || keycode.equals("SHIFT")) { actions.keyDown(webElement, keys); actions.keyUp(webElement, keys); Action action = actions.build(); action.perform(); } else { webElement.sendKeys(keys); }/*from w w w . j av a2 s . co m*/ } } else { webElement.sendKeys(keySequence); } }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void keyUp(String locator, String keySequence) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); String keycode = keySequence.substring(1); Keys keys = Keys.valueOf(keycode);/* ww w . j a v a2 s . co m*/ actions.keyUp(webElement, keys); Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void mouseDown(String locator) { WebElement webElement = getWebElement(locator); scrollWebElementIntoView(webElement); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); actions.moveToElement(webElement);/*from w w w. j a v a 2 s . c om*/ actions.clickAndHold(webElement); Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void mouseDownAt(String locator, String coordString) { WebElement webElement = getWebElement(locator); scrollWebElementIntoView(webElement); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); if (Validator.isNotNull(coordString) && coordString.contains(",")) { String[] coords = coordString.split(","); int x = GetterUtil.getInteger(coords[0]); int y = GetterUtil.getInteger(coords[1]); actions.moveToElement(webElement, x, y); actions.clickAndHold();// ww w .j a v a 2s.co m } else { actions.moveToElement(webElement); actions.clickAndHold(webElement); } Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void mouseMove(String locator) { WebElement webElement = getWebElement(locator); scrollWebElementIntoView(webElement); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); actions.moveToElement(webElement);/*from w w w . j av a 2 s .c o m*/ Action action = actions.build(); action.perform(); }
From source file:com.liferay.cucumber.selenium.BaseWebDriverImpl.java
License:Open Source License
@Override public void mouseMoveAt(String locator, String coordString) { WebElement webElement = getWebElement(locator); scrollWebElementIntoView(webElement); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); if (Validator.isNotNull(coordString) && coordString.contains(",")) { String[] coords = coordString.split(","); int x = GetterUtil.getInteger(coords[0]); int y = GetterUtil.getInteger(coords[1]); actions.moveToElement(webElement, x, y); } else {//w ww. jav a 2s . c om actions.moveToElement(webElement); } Action action = actions.build(); action.perform(); }