What should I do in case Webdriver cannot be resolved to a type java?
"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 occurred when writing a TestNG program. Before the TestNg installation, the selenium program is executing properly. It doesn't give such a type of error. This type of error occurs only after TestNG installation, I had to uninstall TestNG and then again install TestNG 2 times also. But I'm still facing the same problem.
This error - cannot be resolved to a type java means that Eclipse IDE cannot find the required classes in your class path. Probably you have accidentally removed WebDriver jars or selenium jars when adding TestNg. If you use Maven check also that you are using the proper scope of dependencies. If your code resides under the test folder and your dependencies do not have test scope, then you might get issues with class visibility.