0
import org.openqa.selenium.By;  
import org.openqa.selenium.WebDriver;  
import org.openqa.selenium.chrome.ChromeDriver;  
  
public class Frst{  
  
    public static void main(String[] args) {  
        
    // declaration and instantiation of objects/variables  
    System.setProperty("webdriver.chrome.driver", "F:\\Eclipse\\New folder\\chromedriver.exe");  
    WebDriver driver=new ChromeDriver();  
      
// Launch website  
    driver.navigate().to("http://www.google.com/");  
          
    // Click on the search text box and send value  
    driver.findElement(By.id("lst-ib")).sendKeys("hudai");  
          
    // Click on the search button  
    driver.findElement(By.name("btnK")).click();  
      
    }  
  
}

Error: Unable to initialize main class Frst Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver

  • Does this answer your question? [Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver](https://stackoverflow.com/questions/47823506/exception-in-thread-main-java-lang-noclassdeffounderror-org-openqa-selenium-w) – Karthikeyan Apr 21 '22 at 07:26

0 Answers0