|
|
|
@ -223,22 +223,46 @@ public class BrowserCommon {
|
|
|
|
|
/** |
|
|
|
|
* mouse drag element |
|
|
|
|
* |
|
|
|
|
* @param source_locator BY |
|
|
|
|
* @param target_locator BY |
|
|
|
|
* @param sourceLocator BY |
|
|
|
|
* @param targetLocator BY |
|
|
|
|
*/ |
|
|
|
|
public void dragAndDrop(By source_locator, By target_locator) { |
|
|
|
|
WebElement sourceElement = locateElement(source_locator); |
|
|
|
|
WebElement targetElement = locateElement(target_locator); |
|
|
|
|
public void dragAndDrop(By sourceLocator, By targetLocator) { |
|
|
|
|
WebElement sourceElement = locateElement(sourceLocator); |
|
|
|
|
WebElement targetElement = locateElement(targetLocator); |
|
|
|
|
actions.dragAndDrop(sourceElement, targetElement).perform(); |
|
|
|
|
actions.release(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void moveToDragElement(By target_locator, int X, int Y) { |
|
|
|
|
WebElement targetElement = locateElement(target_locator); |
|
|
|
|
actions.dragAndDropBy(targetElement, X, Y).perform(); |
|
|
|
|
public void moveToDragElement(By targetLocator, int x, int y) { |
|
|
|
|
WebElement targetElement = locateElement(targetLocator); |
|
|
|
|
actions.dragAndDropBy(targetElement, x, y).perform(); |
|
|
|
|
actions.release(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Right mouse click on the element |
|
|
|
|
* |
|
|
|
|
* @param locator By |
|
|
|
|
* @return actions |
|
|
|
|
*/ |
|
|
|
|
public void mouseRightClickElement(By locator) { |
|
|
|
|
WebElement mouseRightClickElement = locateElement(locator); |
|
|
|
|
actions.contextClick(mouseRightClickElement).perform(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The mouse moves from a position to a specified positionØ |
|
|
|
|
* |
|
|
|
|
* @param sourceLocator BY |
|
|
|
|
* @param targetLocator BY |
|
|
|
|
* @return actions |
|
|
|
|
*/ |
|
|
|
|
public void mouseMovePosition(By sourceLocator, By targetLocator) throws InterruptedException { |
|
|
|
|
WebElement sourceElement = locateElement(sourceLocator); |
|
|
|
|
WebElement targetElement = locateElement(targetLocator); |
|
|
|
|
actions.dragAndDrop(sourceElement,targetElement).perform(); |
|
|
|
|
actions.click(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* jump page |
|
|
|
|