-
Notifications
You must be signed in to change notification settings - Fork 0
/
Drawing.java
53 lines (45 loc) · 1.33 KB
/
Drawing.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;
package org.openqa.selenium;
public class Drawing {
{
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver","C:\\Users\\pathtyourchrome\\chromedriver.exe");
WebElement line = driver.findElement(By.Xpath(""));
WebElement rectangle = driver.findElement(By.Xpath(""));
WebElement eraser = driver.findElement(By.Xpath(""));
WebElement element = driver.findElement(By.Xpath(""));
String url = "" ;
driver.get(url);
public static drawing_horizontal_line()
{
line.click();
MoveToElement(element , 200 , 250).perform();
clickAndHold().perform();
moveByOffset(200 , 0).perform();
release().perform();
}
public static drawing_vertical_line()
{
line.click();
MoveToElement(element ,300 , 200).perform();
clickAndHold().perform();
moveByOffset(0 , 100).perform();
release().perform();
}
public static drawing_rectangle()
{
rectangle.click();
MoveToElement(element ,200 , 350).perform();
clickAndHold().perform();
moveByOffset(200 , 100).perform();
release().perform();
}
public static deleting_horizontal_line()
{
eraser.click();
MoveToElement(element , 200 , 250).perform();
clickAndHold().perform();
moveByOffset(200 , 0).perform();
release().perform();
}
}