Saturday, February 27, 2016

Java :Classpath and library error even when dependencies are added to Gradle

Classpath and library error even when dependencies are added to Gradle


I have added all dependencies in "build.gradle" required for a selenium project.But still i am getting error when i try to launch a firefox driver using : WebDriver driver = new FirefoxDriver();


Solution : 
 
1. Make sure that you have imported the FirefoxDriver class in your code. Add the following line in your import section.

    import org.openqa.selenium.firefox.FirefoxDriver;

2. Clean the Gradle project (https://www.jetbrains.com/idea/help/gradle-tool-window.html)
3. Refresh the project (File>Synchronize)
4. Use the refresh button in Gradle Tool Window if ".gradle" file is edited
https://www.jetbrains.com/idea/help/gradle-tool-window.html


Note :All Dependencies add should appear in Gradle Tool Window >Dependencies

No comments:

Post a Comment