-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPopup.java
More file actions
26 lines (20 loc) · 714 Bytes
/
Popup.java
File metadata and controls
26 lines (20 loc) · 714 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
package VINDVG1.Vinay27;
import org.openqa.selenium.Alert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
public class Popup {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("https://demoqa.com/alerts");
Thread.sleep(5000);
driver.manage().window().maximize();
Thread.sleep(5000);
driver.findElement(By.id("alertButton")).click();
Alert av = driver.switchTo().alert();
av.accept();
System.out.println("script sucess");
}
}