-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTest3.java
More file actions
34 lines (20 loc) · 865 Bytes
/
Test3.java
File metadata and controls
34 lines (20 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package actions;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class Test3 {
public static void main(String[] args) throws InterruptedException {
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://www.dhtmlgoodies.com/submitted-scripts/i-google-like-drag-drop/");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
WebElement block1 = driver.findElement(By.xpath("//h1[text()='Block 1']"));
WebElement block4 = driver.findElement(By.xpath("//h1[text()='Block 4']"));
Thread.sleep(5000);
Actions a=new Actions(driver);
a.dragAndDrop(block1,block4).perform();
}
}