-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDraganddrop.java
More file actions
32 lines (24 loc) · 938 Bytes
/
Draganddrop.java
File metadata and controls
32 lines (24 loc) · 938 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
package VINDVG1.Vinay27;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebElement;
public class Draganddrop {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("https://demoqa.com/droppable");
//to maximize widows
driver.manage().window().maximize();
//Action class to using JS action on Objects
Actions buil=new Actions(driver);
WebElement from=driver.findElement(By.id("draggable"));
WebElement to=driver.findElement(By.id("droppable"));
//to perform actions
buil.dragAndDrop(from, to).perform();
//buil.dragAndDropBy(from, 500, 150).perform();
System.out.println("Script sucess");
}
}