getting error in testng java lang NoClassDefFoundError com google common collect ImmutableMap

+1 vote
getting this error

java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap

here is the code:

package testngpkg;

import org.openqa.selenium.WebDriver;

import org.testng.annotations.Test;

public class firstclass {
 WebDriver driver;
  public void browser() {
   driver = new ChromeDriver();
Feb 14, 2020 in Selenium by Aarti
• 130 points
Do u have the Guava libraries imported in your classpath?

1 answer to this question.

0 votes

A NoClassDefFoundError is thrown when the JRE can't find a class. In your case, it can't find the class, which you most probably did not add to your classpath.


After downloading the following libraries:



Apache HttpComponents:

JSON jar:

and unzipping them and putting all JAR files in a folder called lib, the test class:

answered Jun 3, 2020 by Ramesh
• 140 points
Hey @Ramesh thanks, buddy! but the JSON jar link isn't accessible.

Related Questions In Selenium

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Getting error while running a XML file in TestNG

Hello @Sradha, The synatx of using test is ...READ MORE

answered Dec 26, 2018 in Selenium by Rashmi
0 votes
0 answers
+1 vote
0 answers
0 votes
2 answers

TestNG error:- Cannot find class in classpath

The above link didn't work it means ...READ MORE

answered Feb 12, 2020 in Selenium by Rashmi Reddy PR
+1 vote
3 answers

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

The only reason for ClassNotFoundException is if ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,520 points