1

So, I am starting to learn how to use selenium and wanted to start off by opening the google website. I followed this tutorial and so far I have this code:

import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Proj {
    public static void main(String[] args) {
        System.out.println("hi");

        System.setProperty("webdriver.chrome.driver", "C:\\Users\\sehaf\\Downloads\\chromedriver_win32\\chromedriver.exe");

        WebDriver driver = new ChromeDriver(); 

        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
        driver.manage().window().maximize();

        driver.get("https://www.google.com");

        driver.close();
        System.out.println("bhye");

    }
}

The problem seems to be with creating a new ChromeDriver object and I suspect it may have something to do with how I set my project up or the setProperty line. Also, I am using Intellij but most of the information I find online is using Eclipse. I would greatly appreciate any help, and if you have any websites or places to start learning how to work with selenium that would be great.

Ajeet Verma
  • 2,938
  • 3
  • 13
  • 24
Fady Seha
  • 11
  • 2

0 Answers0