Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
739 views
by Contributing Tester (92 points)

UnsupportedClassVersionError while launching browser with Selenium 3.0.1

Getting this exception whereas it used to work with older versions

Exception -->

Exception in thread "main" java.lang.UnsupportedClassVersionError: LaunchBrowser : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
 
 
Code -->
 
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
 
public class LaunchBrowser {
public static void main(String args[]) {
 
WebDriver driver;
 
driver = new FirefoxDriver();
 
driver.get("google.com");
 
}
}
 
 
Please help with resolution
by The go-to Tester (181 points)
What's your jdk version?

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer
I doubt that the JDK you are using is outdated. Kindly update your JDK to the latest version. It should resolve your error. For Selenium 3.0.1 you need minimum JDK version 1.8.

 

Hope that helps!
by Contributing Tester (92 points)
After analysis,figured out that FF v<50 is not supported with webdriver 3.0.1
by The go-to Tester (181 points)
Thank you for sharing the solution.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...