본문 바로가기
QA/Test Automation

Selenium point to point link

by 화뉘 2016. 7. 12.

moveToElement는 해당 Element의 top-left를 0,0으로 계산해서 이동시켜준다.


Actions operation = new Actions(driver);

WebElement vportIn = driver.findElement(By.id("vport-ns-in"));

WebElement vportOut = driver.findElement(By.id("vport-ns-out"));

int vportInWidth = vportIn.getSize().getWidth();

System.out.println("size of port-in : " + vportInWidth);

int vportInHeight = (vportIn.getSize().getHeight())/2;

System.out.println("size of port-in : " + vportInHeight);


int vportOutHeight = (vportIn.getSize().getHeight())/2;

System.out.println("size of port-out : " + vportOutHeight);

operation.moveToElement(vportIn,vportInWidth,vportInHeight).clickAndHold().moveToElement(vportOut,0,vportOutHeight).build().perform();;      

댓글