-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment146_.java
More file actions
35 lines (20 loc) · 851 Bytes
/
Assignment146_.java
File metadata and controls
35 lines (20 loc) · 851 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
35
package BasicsSelenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
//WAP to Drag postman to drop zone https://grotechminds.com/drag-and-drop/ ?
public class Assignment146_ {
public static void main(String[] args) throws InterruptedException {
ChromeDriver driver = new ChromeDriver();
driver.get("https://grotechminds.com/drag-and-drop/");
driver.manage().window().maximize();
WebElement drag = driver.findElement(By.xpath("(//img[@id='drag11'])"));
Thread.sleep(2000);
WebElement drop = driver.findElement(By.xpath("(//div[@id='div2'])"));
Actions a1 = new Actions(driver); // Action Class
a1.dragAndDrop(drag, drop).perform(); // DragandDrop Method
Thread.sleep(5000);
driver.quit();
}
}