I\'m creating a basic selenium Webdriver program by adding the selenium jars and relative jars, below is my code. but when i try to resolve firefordriver and webdriver for i
Add selenium jars and other required jars to build path of your project in Eclipse and Rebuild the project.
Add jars like this
Right click on project --> Configure BuildPath --> Java Build Path Libraries -->
Double click on JRE SYSTEM LIBRARY --> Then select alternate JRE
From C:\Program Files (x86)\Java\jre7\lib your path where you store JRE
Refer this answer
delete module-info.java file or any other module file that was created at the time of creating the project. That will resolve the issue.
You have to remove the module-info.java class from project it will works. Module info is not required for selenium project. So you can remove it :)
This error message...
The import org cannot be resolved
...implies that your program was unable to resolve the following imports:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
Your main issue for the imports not getting reslved is circular-dependency.
Though you have added all the selenium jars and relative jars but you have named the program Module / Package as selenium as follows:
package selenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
This is causing a circular-dependency hence the imports are not getting resolved through the selenium related jars.
Changing/Modifying the Module / Package name from selenium
to something else, e.g. myProgram
will solve the issue.