"The import org.openqa cannot be resolved".

"WebDriver cannot be resolved to a type".

"ChromeDriver cannot be resolved to a type".

This type of error occured when writing TestNG program. Before TestNg installation, selenium program is executing properly. It doesn't gives such type of error. This type of error occurs only after TestNG installation, I had uninstall TestNG and then again install TestNG 2 times also. But still facing same problem.

2 Answers 2


This error means that Eclipse IDE cannot find the required classes in your class path. Probably you have accidentally removed WebDriver jars or selenium jars when added TestNg.

If you use Maven check also that you are using the proper scope of dependencies. If your code resides under test folder and your dependencies do not have test scope, then you might get issues with class visibility.


Try cleaning your project by going to the following menu

Project > Clean

If it doesn't work still, try to remove the jars from the build path and add them again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.