2

I have this script in InteliJ Idea

package com.test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Main {
    public static void main(String[] args) throws InterruptedException {
    // write your code here
        WebDriver driver = new ChromeDriver();
        driver.get("https://cs.wikipedia.org/wiki/Wiki");
        WebElement link;
        link = driver.findElement(By.linkText("English"));
        link.click();
        Thread.sleep(5000);
        WebElement searchbox;
        searchbox = driver.findElement(By.id("searchInput"));
        searchbox.sendKeys("Software");
        Thread.sleep(5000);
        driver.quit();
    }
}

When i tried to run it it gives me this error:

"C:\Program Files\Java\jdk-10.0.2\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.1\lib\idea_rt.jar=51622:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\Jenda\IdeaProjects\test\out\production\test;D:\automatizace testů\selenium\selenium-java-3.141.59\client-combined-3.141.59.jar;D:\automatizace testů\selenium\selenium-java-3.141.59\libs\byte-buddy-1.8.15.jar;D:\automatizace testů\selenium\selenium-java-3.141.59\libs\commons-exec-1.3.jar;D:\automatizace testů\selenium\selenium-java-3.141.59\libs\guava-25.0-jre.jar;D:\automatizace testů\selenium\selenium-java-3.141.59\libs\okhttp-3.11.0.jar;D:\automatizace testů\selenium\selenium-java-3.141.59\libs\okio-1.14.0.jar;D:\automatizace testů\selenium\selenium-java.jar;D:\automatizace testů\selenium\guava-14.0.jar;D:\automatizace testů\selenium\json-20080701.jar;D:\automatizace testů\selenium\selenium-api-2.31.0.jar" com.test.Main
Error: Unable to initialize main class com.test.Main
Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver

Process finished with exit code 1

could you please give me some advice what is wrong?

Jan Motl
  • 21
  • 1

0 Answers0