排练对象:
`Point coordinates1 = from.getLocation();
Point coordinates2 = to.getLocation();
TouchActions builder = new TouchActions(driver);
builder.longPress(coordinates1)
.move(coordinates2).release(coordinates2).perform();`
`Actions builder = new Actions(driver);
int x2 =to.getLocation().getX();
int y2 = to.getLocation().getY();
builder.clickAndHold(from);
builder.moveByOffset(x2,y2);
builder.moveToElement(from);
builder.release();
`browser.actions().
mouseDown(element1).
mouseMove(x:-1,y:-1).
mouseMove(element2).
mouseUp().
`Actions act = new Actions(driver);
act.clickAndHold(from).build().perform();
act.moveToElement(to).build().perform();
`Actions builder = new Actions(driver);
`Actions builder = new Actions(driver);
from.click();
builder.clickAndHold(from).build().perform();
builder.moveByOffset(276, 64).build().perform();
builder.moveToElement(to).build().perform();
`Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(from)
.moveToElement(to)
.release(from)
.build();
new Actions(driver).dragAndDrop(from, to).build().perform();
答案 0 :(得分:0)
Point coordinates1 = from.getLocation();
Point coordinates2 = to.getLocation();
TouchActions builder = new TouchActions(driver);
builder.longPress(coordinates1)
.move(coordinates2).release(coordinates2).perform();
Actions builder = new Actions(driver);
int x2 =to.getLocation().getX();
int y2 = to.getLocation().getY();
builder.clickAndHold(from);
builder.moveByOffset(x2,y2);
builder.moveToElement(from);
builder.release();
builder.perform();
browser.actions().
mouseDown(element1).
mouseMove(x:-1,y:-1).
mouseMove(element2).
mouseUp().
perform();
Actions act = new Actions(driver);
act.clickAndHold(from).build().perform();
act.moveToElement(to).build().perform();
act.release(to).build().perform();
Actions builder = new Actions(driver);
builder.clickAndHold(from).moveToElement(to).release().build().perform();
Actions builder = new Actions(driver);
from.click();
builder.clickAndHold(from).build().perform();
builder.moveByOffset(276, 64).build().perform();
builder.moveToElement(to).build().perform();
builder.release().build().perform();
Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(from)
.moveToElement(to)
.release(from)
.build();
dragAndDrop.perform();