-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay1.java
More file actions
30 lines (24 loc) · 1021 Bytes
/
Copy pathDay1.java
File metadata and controls
30 lines (24 loc) · 1021 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
package Guru99;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Day1 {
public static void main(String[] args) throws InterruptedException, IOException {
WebDriverManager.chromedriver();
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.demo.guru99.com/V4/index.php");
driver.findElement(By.name("uid")).sendKeys("mngr563814");
driver.findElement(By.name("password")).sendKeys("qYsajem");
driver.findElement(By.name("btnLogin")).click();
File vsfile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(vsfile,new File(".//SSSS/VIN.png"));
System.out.println("Login Sucess");
}
}