forked from Sonal0409/8PMJulyBatchJava-SeleniumPrograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupCheck.java
More file actions
68 lines (26 loc) · 1.3 KB
/
SetupCheck.java
File metadata and controls
68 lines (26 loc) · 1.3 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package seleniumScripts;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SetupCheck {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
// Test Case is : to Open wiki create account page in chrome browser
// Provide the browser driver details
// System.setProperty(name of the driver, path of driver in your machine along with chromedriver.exe file name)
System.setProperty("webdriver.chrome.driver", "C:\\Users\\vishal mittal\\Downloads\\chromedriver_win32 (12)\\chromedriver.exe");
// open the browser -- ChromeBrowser
// WebDriver interface ----> ChromeDriver , FireFoxDriver
WebDriver driver= new ChromeDriver();
// Maximize the browser
driver.manage().window().maximize();
// delete cookies on the browser
driver.manage().deleteAllCookies();
// open the application on the browser -- get() method
driver.get("https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&returnto=Selenium+%28software%29");
driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);
Thread.sleep(3000);
// close the browser
driver.close();
}
}