java.lang.ClassNotFoundException: okhttp3.ConnectionPool - Selenium Error

+1 vote

Below is my simple Selenium Test Code:

public static void main(String[] args) {

    System.setProperty("webdriver.chrome.driver", "/home/chromedriver");
    WebDriver driver= new ChromeDriver();

    driver.get("http://google.com");
}

And still i get an error: 

Exception in thread "main" java.lang.NoClassDefFoundError: okhttp3/ConnectionPool | Caused by: java.lang.ClassNotFoundException: okhttp3.ConnectionPool
Mar 30, 2018 in Selenium by Shubham
• 12,270 points
1,825 views

3 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Best answer
The only reason for ClassNotFoundException is if your JARS are not right. First download the latest jar files from here: https://www.seleniumhq.org/download/. Also download the latest ChromeDriver. Update Chrome to the latest version supported by the chromedriver. And make sure the JARS are added appropriately. Then you should be fine.

Do let me know if this works.
answered Mar 30, 2018 by nsv999
• 5,030 points

selected May 16, 2018 by Sudhir
Doesn't work
which version of Selenium Jars, & chromedriver are you using?
+1 vote

okhttp-3.10.0.jar & okio1.14.1.jar may be solve using this jar files your problem java.lang.NoClassDefFoundError: okhttp3/ConnectionPool

answered Aug 28, 2018 by Surendra Patil
Thanks Surendra. Never knew there was a JAR file named like these. Let's hope @shubhamsinha's error is solved.
0 votes
give a full path for system property and escape the slash used
answered Jan 14 by Sourabh

Related Questions In Selenium

0 votes
1 answer

Java.lang.CharSequence cannot be resolved error while using sendKeys() using Selenium Webdriver

You could try this, myElement .sendKeys(new String[] { ...READ MORE

answered Apr 4, 2018 in Selenium by Johnathon
• 9,050 points
410 views
0 votes
2 answers
0 votes
3 answers

java.lang.IllegalStateException Error after adding set property webdriver

/* System.setProperty("WebDriver.gecko.driver", "C:\\Users\\DELL\\Desktop\\GeckoDriver1\\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); */ ...READ MORE

answered May 1 in Selenium by anonymous
1,515 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
76 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
448 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
56 views
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,030 points
1,237 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.