-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample2_3.java
More file actions
25 lines (20 loc) · 788 Bytes
/
Example2_3.java
File metadata and controls
25 lines (20 loc) · 788 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
package com.SeleniumTestingSamples.Examples;
import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
//Firefox PageSource
public class Example2_3 {
public static void main(String[] args) {
//WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
String URL = "https://www.google.com/";
driver.get(URL);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(6000));
String getCurrentUrl = driver.getCurrentUrl();
System.out.println("Current URL of Home page: "+ getCurrentUrl);
String getPageSource = driver.getPageSource();
System.out.println("Page Source "+getPageSource);
driver.close();
}
}