Advertisement
Guest User

Selenium with chromedriver

a guest
Jan 8th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.io.File;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.chrome.ChromeDriver;
  4.  
  5. public class GoogleSearch {
  6.  
  7.     public static void main(String[] args) throws InterruptedException {
  8. // FOR PC       File file = new File("D:/Programme/JavaSoftware/WEB/chromedriver.exe");
  9.         File file = new File("/opt/web/chromedriver");
  10.         System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
  11.         WebDriver driver = new ChromeDriver();
  12.         driver.get("https://www.google.com/");
  13.         System.out.println(driver.getTitle());
  14.         driver.close();
  15.         driver.quit();
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement