Issues with the Chrome driver

86 views
Skip to first unread message

David Suarez

unread,
Nov 18, 2022, 2:41:48 AM11/18/22
to Selenium Users
Hi all.

I am trying to execute a basic code to test the Chrome driver in a windows 10 machine. I am running the following code from console (CMD).

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class webSelenium {

    public static void openWeb (String goods)
    {
        System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("http://localhost:5000/"+goods);
    }
    public static void main (String [] args){
        webSelenium.openWeb("add");
    }    
}

When I try to compile this code from console, I got this error

C:\Users\davsuar\Documents\FX9500 Zebra SDK>javac webSelenium.java
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
webSelenium.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
                          ^
webSelenium.java:2: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
                                 ^
webSelenium.java:9: error: cannot find symbol
        WebDriver driver = new ChromeDriver();
        ^
  symbol:   class WebDriver
  location: class webSelenium
webSelenium.java:9: error: cannot find symbol
        WebDriver driver = new ChromeDriver();
                               ^
  symbol:   class ChromeDriver
  location: class webSelenium
4 errors

C:\Users\davsuar\Documents\FX9500 Zebra SDK>

I've tried to install this driver by using the path method. Also, I used  Selenium Manager script in order to set up the driver, I've rebooted the machine many time, changed the folder where the diver is located, assigned the correct permission to the folder where the driver is saved, set up the path and classpath with different locations but the issue persist.

I will appreciate any idea or help that you can provide me

Thanks
  

Reply all
Reply to author
Forward
0 new messages