Sempre que tento rodar a aplicação, o sistema exibe o erro "A Java Exception has occurred.". Percorri todos os tópicos, fiz tudo o que foi sugerido aos outros, mas nenhum solucionou meu problema. Abaixo, segue o código:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class TesteAutomatizado {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver",
"C:\\Users\\Fernanda\\Desktop\\Cursos TI\\ALURA\\Selenium\\geckodriver.exe");
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\Fernanda\\Desktop\\Cursos TI\\ALURA\\Selenium\\chromedriver_win32_v2.25.exe");
// DesiredCapabilities capabilities = DesiredCapabilities.chrome();
// WebDriver driver = new ChromeDriver(capabilities);
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com.br");
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Caelum");
campoDeTexto.submit();
}
}
E o erro exibido no console:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
at java.lang.Class.getMethod0(Class.java:2866)
at java.lang.Class.getMethod(Class.java:1676)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)