I have installed jdk-12.0.2 64bit on Windows 7 64bit Service Pack 1, I am using Eclipse IDE for Enterprise Java Developers. Version: 2019-06 (4.12.0) Build id:20190614-1200.
I created a new java project having a new package and a new java class.
When I added the following Jars in Project Build Path:
selenium-server-standalone-3.141.59.jar
selenium-3.141.59-nodeps.jar
selenium-3.141.59-nodeps-sources.jar (with and without this jar)
all jar files of lib folder
Then import entry import org.openqa.selenium.WebDriver; shows following error
The package org.openqa.selenium is accessible from more than one module: okio, org.openqa.selenium.core, selenium
other import entry import org.openqa.selenium.chrome.ChromeDriver; shows following error The type org.openqa.selenium.chrome.ChromeDriver is not accessible
When I removed selenium-server-standalone-3.141.59.jar from project build path then got the following exception.
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for D:\SS\Selenium-3.0.0\lib\xalan-2.7.2.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module
I have already worked with Selenium 3.0 using JDK 1.8. with (Chrome, IE, Gecho) browsers.
Here with jdk-12.0.2, I have also tried selenium 3.0, with alternative addition and removal of jars. Also tried by adding/removing of jars from Selenium-Server-xxx versions.
Following is the Java class code:
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class loginPage {
WebDriver wd;
public void invokeBrowser() {
System.setProperty("webdriver.chrome.driver", "D:\\SS\\Selenium-3.141.59\\chromedriver.exe");
wd = new ChromeDriver();
wd.manage().deleteAllCookies();
wd.manage().window().fullscreen();
wd.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
wd.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
wd.get("http://myurl/"); }
public static void main(String[] args) {
loginPage mlp = new loginPage();
mlp.invokeBrowser(); }
}