-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenshot1.java
More file actions
27 lines (20 loc) · 856 Bytes
/
Screenshot1.java
File metadata and controls
27 lines (20 loc) · 856 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
package VINDVG1.Vinay27;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Screenshot1 {
public static void main(String[] args) throws IOException {
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("https://in.search.yahoo.com/search?fr=mcafee&type=E211IN1316G0&p=cadmaxx+solutions");
driver.manage().window().maximize();
File vsfile=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(vsfile,new File(".//screenshot/sap.png"));
System.out.println("Scrpit sucess");
}
}