-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScreenshot5.java
33 lines (25 loc) · 1 KB
/
Screenshot5.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
package VINDVG1.Vinay27;
import java.io.File;
import java.util.Date;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Screenshot5 {
public static void main(String[] args) throws IOException {
Date currentdate = new Date();
//System.out.println(currentdate);
String Spe=currentdate.toString().replace(" ","-").replace(":","-");
//System.out.println(screenshotfilename);
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("https://www.wingslide.com/careers");
driver.manage().window().maximize();
File as=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(as, new File(".//screenshot/"+Spe+".png"));
System.out.println("Script sucess");
}
}