-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitledTest.java
113 lines (113 loc) · 4.31 KB
/
UntitledTest.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Generated by Selenium IDE
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNot.not;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Alert;
import org.openqa.selenium.Keys;
import java.util.*;
import java.net.MalformedURLException;
import java.net.URL;
public class UntitledTest {
private WebDriver driver;
private Map<String, Object> vars;
JavascriptExecutor js;
@Before
public void setUp() {
driver = new ChromeDriver();
js = (JavascriptExecutor) driver;
vars = new HashMap<String, Object>();
}
@After
public void tearDown() {
driver.quit();
}
@Test
public void untitled() {
driver.get("https://www.youtube.com/");
driver.manage().window().setSize(new Dimension(2149, 1209));
driver.findElement(By.cssSelector(".style-scope:nth-child(7) > #text")).click();
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(3) > #content .yt-core-image--fill-parent-height"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(2) > #content #video-title"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(5) > #content #video-title"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
driver.findElement(By.cssSelector("#right-arrow-button .yt-spec-touch-feedback-shape__fill")).click();
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(5) > #content .yt-core-image--fill-parent-height"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
driver.findElement(By.cssSelector(".style-scope:nth-child(6) > #content #img")).click();
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(6) > #content #img"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(6) > #dismissible > #details > #menu #button > #button"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
{
WebElement element = driver.findElement(By.cssSelector(".style-scope:nth-child(3) > #dismissible .yt-core-image--fill-parent-height"));
Actions builder = new Actions(driver);
builder.moveToElement(element).perform();
}
{
WebElement element = driver.findElement(By.tagName("body"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 0, 0).perform();
}
driver.close();
}
}