Exception in thread “main” java.lang.NoClassDefFoundError: okhttp3/ConnectionPool with Selenium and Java

后端 未结 4 1441
南旧
南旧 2020-12-11 22:36

i have a simple Selenium Test Code:

public static void main(String[] args) {

    System.setProperty(\"webdriver.chrome.driver\", \"/home/chromedriver\");
           


        
4条回答
  •  抹茶落季
    2020-12-11 23:40

    I hope, your trying a method without having class. Please try to put your main method inside class. please let me know if you are getting any error further.

    class Test{

    public static void main(String[] args) {

    System.setProperty("webdriver.chrome.driver", "youHaveToUseLocationWhereYouHaveYourChromeDriver");
    WebDriver driver= new ChromeDriver();
    
    driver.get("http://google.com");
    

    } }

提交回复
热议问题