-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMousehover.java
53 lines (46 loc) · 1.88 KB
/
Mousehover.java
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class Mousehover {
private WebDriver driver;
private Mousehoverkoarkopage nayapage;
@BeforeTest
public void first() throws InterruptedException{
System.setProperty("web-driver.chrome.driver","D:\\\\browserdriver\\\\chromedriver\\\\chromedriver.exe");
driver=new ChromeDriver();
nayapage=new Mousehoverkoarkopage(driver);
// driver.get("https://www.hamropatro.com/");
// driver.get("https://jqueryui.com/droppable/");
driver.get("https://jqueryui.com/resizable/");
String title=driver.getTitle();
driver.manage().window().maximize();
}
@Test
public void t1() throws InterruptedException{
driver.switchTo().frame(nayapage.getframe());
Thread.sleep(1000);
Actions action=new Actions(driver);
action.dragAndDropBy(nayapage.getresize(),300,150).perform();
// The following code drags and drops the loop is just for fun
//******************************
// for(int i =1;i>0;i++) {
// Thread.sleep(1000);
// driver.switchTo().frame(nayapage.getframe());
// Thread.sleep(1000);
//
// Actions action = new Actions(driver);
// action.dragAndDrop(nayapage.getdrag(), nayapage.getdrop()).perform();
// Thread.sleep(1000);
// driver.navigate().refresh();
// }
//*******************************
// yo tala ko code le chai hover garxa
// action.moveToElement(nayapage.getremita()).perform();
// Thread.sleep(1000);
// action.moveToElement(nayapage.getgiftsa()).perform();
// Thread.sleep(1000);
// action.moveToElement(nayapage.getrashifal()).perform();
}
}