- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindowAlert.java
More file actions
Latest commit
33 lines (21 loc) · 761 Bytes
/
Copy pathWindowAlert.java
File metadata and controls
33 lines (21 loc) · 761 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
packagecom.seleniumhq;
importjava.awt.AWTException;
importjava.awt.Robot;
importjava.awt.event.KeyEvent;
importjava.util.concurrent.TimeUnit;
importorg.openqa.selenium.By;
importorg.openqa.selenium.WebDriver;
importorg.openqa.selenium.firefox.FirefoxDriver;
publicclassWindowAlert {
publicstaticvoidmain(String[] args) throwsInterruptedException, AWTException {
WebDriverdriver = newFirefoxDriver();
driver.get("http://www.seleniumhq.org/download/");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.partialLinkText("2.47")).click();
Robotr = newRobot();
Thread.sleep(1000);
r.keyPress(KeyEvent.VK_LEFT);
Thread.sleep(1000);
r.keyPress(KeyEvent.VK_ENTER);
}
}