java lang ClassNotFoundException okhttp3 ConnectionPool - Selenium Error

+1 vote

Below is my simple Selenium Test Code:

public static void main(String[] args) {

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


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
• 13,480 points

3 answers to this question.

0 votes
Best answer
The only reason for ClassNotFoundException is if your JARS are not right. First download the latest jar files from here: 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,500 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.

Hello Surendra.

I'm getting below error after adding the okhttp-3.10.0.jar & okio1.14.1.jar file into my project.

:- java.lang.NoClassDefFoundError: org/apache/commons/exec/Executor

0 votes
give a full path for system property and escape the slash used
answered Jan 14, 2019 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,090 points
+2 votes
3 answers

Error occurred during initialization of boot layer java.lang.module.FindException: Module Selenium not found

This might probably be coz while creating ...READ MORE

answered Nov 27, 2019 in Selenium by Sirajul
• 59,070 points
+2 votes
3 answers

Selenium Webdriver + Java - Eclipse: java.lang.NoClassDefFoundError

I also faced this issue first time, ...READ MORE

answered Aug 28, 2019 in Selenium by Shraddha
0 votes
2 answers

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,500 points
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
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,890 points
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,190 points
+1 vote
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,500 points