Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Eclipse Java import and method not resolved

Posted on 2017-02-25
4
Medium Priority
?
921 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

719 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