Solved

Eclipse Java import and method not resolved

Posted on 2017-02-25
4
50 Views
Last Modified: 2017-03-07
Hello,
I have a couple of "unresolved" issues.  I tried fixing my problems using the options within Eclipse, but nothing works.
I know that I have in import/install the org.opeqa.selenium API, yet can't find the API at org.openqa, and I know that my Selenium API needs to be installed as well.  I thought I did have it via Selinity - Selenium plugin, but I guess not.
These are my issues;
import org.openqa...cannot be resolved
FirefoxDriver cannot be resolved to a type
Method undined for WebDriver

This is the code;
import org.junit.Test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class MyFirstWebdriverTest<WebDriver> {
      @Test
      public void checkSeleniumHQinFirefox(){
        WebDriver driver = new FirefoxDriver();
        driver.get("http://seleniumhq.org");
        driver.quit();
      }
}
0
Comment
Question by:chima
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 42024564
Hi Chima,

You need to download the selenium web driver jars from here and add this to your project build path..

http://selenium-release.storage.googleapis.com/3.1/selenium-java-3.1.0.zip

Download the above link and then you find selenium jar which needs to be added to build path.
0
 

Author Comment

by:chima
ID: 42025922
Siva, I downloaded the Selenium zip file, extracted the file/folder, and added the path to the System Environmental variable path;
C:\Selenium-java-3.1.0\lib     Yet this did not solve my "resolve" issue.  I'll search for the solution, yet I thought I'd enter this comment here/now.
0
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 500 total points
ID: 42025999
Chima, you are using eclipse right?

You need to add the jar files to the build path of the project, no need to add them to the path.

You can refer to this tutorial:

http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)

Method 2 [Add external jars] as that's the easiest one, but method 1 ensures all dependencies are in one project.
0
 

Author Closing Comment

by:chima
ID: 42038233
Thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Facing this issue for maven proxy setting 2 20
Vector, list Questions R 6 32
passing enum to a method 4 23
Why use this lambda? 12 39
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question